Controller does not handle case where image derivate has not been generated

Created on 23 September 2024, 3 months ago

Problem/Motivation

Started seeing multiple errors in the logs with:

Warning: filesize(): stat failed for %fileuri in /app/web/modules/contrib/file_downloader/src/Plugin/DownloadOption/ImageStyle.php on line 64

From URLs matching /download/%imagestyle/%fileid

These appear to be cases where the file id exists but the image derivative has not been generated yet.

Steps to reproduce

View a page with the download link - the image styles are generated
Delete the image styles - e.g.

drush if

Follow the link to download the image style - warning is logged & 404 is received

Proposed resolution

I think the 404 is fine - I don't want somebody to be able to bring the site down crawling random image ids without an image derivative token - but it would be nice if the controller do this without producing a warning.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024