Screenshots broken when unused files set to temporary

Created on 1 April 2025, 1 day ago

Problem/Motivation

As per https://www.drupal.org/node/2891902 β†’ there is an option to maintain legacy Drupal behavior that automatically sets unused files to temporary and deletes them on cron by setting $config['file.settings']['make_unused_managed_files_temporary'] = TRUE; With this setting, trying to save a screenshot using website_feedback results in the following error:
"The file used in the Screenshot field may not be referenced."

Steps to reproduce

  • Install a vanilla Drupal 10 or 11 site.
  • Install website_feedback, and configure to allow screenshots
  • Add the line to settings.php: $config['file.settings']['make_unused_managed_files_temporary'] = TRUE;
  • Attempt to save feedback with a screenshot

Proposed resolution

Manually add a usage to the usage table after saving the screenshot before submitting the feedback form so that the file may be referenced.

πŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dgroene

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