Skip to content

Fix File model and S3 image-bundle compatibility#4

Merged
baldrys-ed merged 2 commits intomainfrom
8.0
Mar 16, 2026
Merged

Fix File model and S3 image-bundle compatibility#4
baldrys-ed merged 2 commits intomainfrom
8.0

Conversation

@baldrys-ed
Copy link
Contributor

@baldrys-ed baldrys-ed commented Mar 16, 2026

Summary

  • Remove relativePath from File model and FileInterface — it broke filesystem storage because the path excluded the storage prefix (e.g. uploads/). For S3, the correct approach is to use S3Loader in image-bundle, not a special path in the model.
  • S3Storage::download() now strips the configured uriPrefix from incoming paths. This allows image-bundle's S3Loader to pass full URIs (received from Twig macros) and still resolve the correct S3 key.

Changes

  • File::__construct() — removed $relativePath parameter
  • FileInterface — removed getRelativePath()
  • Handler::upload() / Handler::inject() — removed third argument from new File()
  • S3Storage::download() — added stripUriPrefix() for image-bundle compatibility

dev and others added 2 commits March 15, 2026 13:57
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>
@baldrys-ed baldrys-ed merged commit e48b48f into main Mar 16, 2026
1 check passed
@baldrys-ed baldrys-ed changed the title 8.0 Fix File model and S3 image-bundle compatibility Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant