Broken thumbnail access when the default download method is set to "Private local files served by Drupal."

Created on 8 April 2025, 9 days ago

Problem/Motivation

Private file system support has been partly supported in 🐛 Image style derivatives not being created due to schema mismatch Active but actually the thumbnail URL gives a 403 when the default download method is private because the image file is not in the managed files Drupal system (no hook_file_download gives access, for example in \Drupal\image\Controller\ImageStyleDownloadController::deliver).

Steps to reproduce

  1. At /admin/config/media/file-system set "Default download method" to "Private local files served by Drupal."
  2. Ensure "Private file system path" exists on the admin config screen above and double-check that it's writable at /admin/reports/status -- look for "File system" and make sure it's "Writable (private download method)".
  3. From a content type field using video_embed_field for remote videos, add a new video from Youtube or other enabled provider.
  4. Configure the content field display widget so that it shows the field value as "Thumbnail".
  5. Visit the content page and notice the video thumbnail image isn't displayed (403 in browser's network panel).
  6. Look at recent log messages (/admin/reports/dblog) and view recent "access denied" errors to find one related to video thumbnail (message should be "Path: /system/files/video_thumbnails/something.jpg. Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: in Drupal\system\FileDownloadController->download()" ).

Proposed resolution

To be found.

Remaining tasks

I think I had no problem with private download method when using 8.x-2.*. I'll check that and if true I'll try to understand what changed.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France GaëlG Lille, France

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