Hi there,
In Sector Drupal 8+ our expectation is that media assets - files, images, local videos - are deleted from the filesystem after the parent media entity is deleted.
One reason why we use media is to allow editorial teams to be able to take control of their files in the public file system. Outdated files or files wrongly uploaded need to be deleted form the file system in a safe and secure manner.
There seems to be no consensus around this in the community at this stage.
Discussion is - https://www.drupal.org/project/drupal/issues/3027324#comment-13027856
Not deleting unused files automatically was introduced in 8.4 following https://www.drupal.org/node/2891902. The main reasons were several critical bugs with the "file usage" tracking: files wrongly set to have >0 uses are deleted even though they are in use. Most issues are around translation, or where files are uploaded to a site without a parent media entity.
In Sector out of the box, we upload all files using media.
Requested change: opt-in to file deletion by changing `make_unused_managed_files_temporary` in the Sector `file.settings` yml config to `TRUE`."
Delete all temporary files on the next cron run when they are older than one hour.
Add to documentation to ensure sitebuilders are aware of this. For Sector sites that use translation we recommend to follow the related issues and opt-out if required or extent the time a file can remain in the temporary directory.
Ta,
Heike
Comment | File | Size | Author |
---|---|---|---|
#3 | auto-delete-files_3150710_3.patch | 633 bytes | DanielVeza |
Comments
Comment #2
HeikeT CreditAttribution: HeikeT at Sparks Interactive commentedComment #3
DanielVezaAdded the make_unused_managed_files_temporary and file.settings settings.
Comment #4
DanielVezaComment #6
DanielVezaCommitted, thanks!