Subbranch of issue/5813: Allow https placeholder examples for ranking-image (experiment) - #5849
Open
kevdevlu wants to merge 2 commits into
Open
Subbranch of issue/5813: Allow https placeholder examples for ranking-image (experiment)#5849kevdevlu wants to merge 2 commits into
issue/5813: Allow https placeholder examples for ranking-image (experiment)#5849kevdevlu wants to merge 2 commits into
Conversation
Widens src's x-allowed-schemes to [public, https] so examples can reference an external placeholder (https://placehold.co/1000x500) directly, instead of shipping a local file via az_media. Two supporting pieces make this actually work: - az_media_canvas_storable_prop_shape_alter() + a hook_module_implements_alter() to force it last: restores the media-library-backed widget for real editing, which Canvas's own mediaLibraryStorablePropShapeAlter() only applies when x-allowed-schemes is exactly ['public'] (confirmed by reading it directly) - adding 'https' breaks that exact match and Canvas's core matching falls back to a plain upload widget with no Media Library integration at all. - ImageStyleTwigExtension: detects an absolute URL pointing back at this site's own public files and converts it back to a public:// URI before styling (ImageStyle::buildUri() otherwise mangles any http(s)-scheme string, local or not, into a bogus derivative path); a genuinely external URL is returned unprocessed, since there's nothing local to generate a WebP/scaled derivative from. With examples now pointing at a remote URL, az_media's local placeholder-1000x500.png (and the hook_install()/hook_update_N() code that shipped it) is no longer needed - removed both. Kept on its own branch rather than merged into issue/5813: this is meaningfully more complex (forks a piece of Canvas's own internal expression logic, adds a hook-ordering dependency, adds a new runtime dependency on an external host) than the already-working alternative - a small, local placeholder image shipped via az_media - for a purely cosmetic, admin-only hover-preview thumbnail. Preserved here in case there's a real future case for supporting genuine external image URLs, rather than just to swap where one placeholder graphic's pixels come from. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
issue/5813: Allow https placeholder examples for ranking-image (experiment)
32 tasks
Adds missing use statements for Canvas/media classes referenced via fully-qualified names, and wraps two comment lines that exceeded the 80-character line length limit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
Tugboat has finished building the preview for this pull request! Link: Dashboard: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subbranch of #5834
Widens src's x-allowed-schemes to [public, https] so examples can reference an external placeholder (https://placehold.co/1000x500) directly, instead of shipping a local file via az_media. Two supporting pieces make this actually work:
With examples now pointing at a remote URL, az_media's local placeholder-1000x500.png (and the hook_install()/hook_update_N() code that shipped it) is no longer needed - removed both.
Kept on its own branch rather than merged into issue/5813: this is meaningfully more complex (forks a piece of Canvas's own internal expression logic, adds a hook-ordering dependency, adds a new runtime dependency on an external host) than the already-working alternative - a small, local placeholder image shipped via az_media - for a purely cosmetic, admin-only hover-preview thumbnail. Preserved here in case there's a real future case for supporting genuine external image URLs, rather than just to swap where one placeholder graphic's pixels come from.
Description
Release notes
Related issues
How to test
Types of changes
Arizona Quickstart (install profile, custom modules, custom theme)
Drupal core
Drupal contrib projects
Checklist