Fix File model and S3 image-bundle compatibility#4
Merged
baldrys-ed merged 2 commits intomainfrom Mar 16, 2026
Merged
Conversation
relativePath was intended for S3 image-bundle integration but caused issues with filesystem storage — the path excluded the storage prefix (e.g. uploads/) making image loader unable to find files. The correct approach for S3 is to use S3Loader in image-bundle, not a special path in the File model. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ibility When image-bundle's S3Loader passes a full URI (e.g. https://cdn/abc.jpg) to download(), strip the configured uriPrefix to extract the S3 key. This allows Twig macros to use src.uri|default(src) universally — both filesystem and S3 paths resolve correctly without special handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
relativePathfromFilemodel andFileInterface— it broke filesystem storage because the path excluded the storage prefix (e.g.uploads/). For S3, the correct approach is to useS3Loaderin image-bundle, not a special path in the model.S3Storage::download()now strips the configureduriPrefixfrom incoming paths. This allows image-bundle'sS3Loaderto pass full URIs (received from Twig macros) and still resolve the correct S3 key.Changes
File::__construct()— removed$relativePathparameterFileInterface— removedgetRelativePath()Handler::upload()/Handler::inject()— removed third argument fromnew File()S3Storage::download()— addedstripUriPrefix()for image-bundle compatibility