- 🇺🇸United States recrit
The patch #21 causes more issues since it overrides all headers returned by the
hook_file_download
hooks.The attached patches take the same approach as the original patch in 🐛 Image derivative generation does not work if effect "Convert" in use and file stored in private filesystem Fixed . It directly sets headers instead of any array merging. This ensures that the content type and length are set correctly.
Bumping to 11.x so that this fix gets some visibility.
Pending: Needs tests - last update
almost 2 years ago 30,363 pass - last update
almost 2 years ago 29,485 pass - last update
almost 2 years ago 30,341 pass - 🇺🇸United States recrit
Updated title and description for the specific case when using the "Convert" effect.
- 🇺🇸United States recrit
Hiding all patch files since an MR has been created for 11.x with the https://www.drupal.org/files/issues/2023-09-26/2786763-24--D11.x.patch →
- First commit to issue fork.
- 🇫🇷France prudloff Lille
I can still reproduce when testing manually.
phpunit tests were not showing the problem because of two problems:
- the convert effect was not saved so the file was not really converted
- ImageModuleTestHooks::fileDownload() is not adding real download headers so it does not trigger the same code path as manual testing
- 🇺🇸United States smustgrave
So looking at the summary and solution don't believe they match up, solution mentions using array_merge() but doesn't appear to be the case.
- Status changed to RTBC
26 days ago 1:36am 10 July 2025 - 🇬🇧United Kingdom catch
It's not clear from the issue summary or the comments whether this really only affects image derivatives when private files are in use, isn't it whenever an image is returned by the controller regardless of file storage? If so the issue title and summary could use an update.