- Issue created by @Chris Matthews
- πΊπΈUnited States Chris Matthews
There is also File Delete β with 14,312 reported installs
The File Delete module adds the ability to easily delete files βboth private and publicβ within Drupal administration.
It changes files from the "Permanent" status to the "Temporary" status. These files will be deleted by Drupal during its cron runs.
If a file is registered as being used somewhere, the Module will not allow it to be deleted.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
+1 from me, it has good test coverage and very little code
- πΊπΈUnited States Chris Matthews
I suppose the 'Media File Delete settings' that live in the contrib module at /admin/config/media/media_file_delete/settings would live in core at /admin/config/media/media-settings
- πΊπΈUnited States Chris Matthews
Moving to Drupal core ideas queue for consensus as to whether or not to move forward with the proposed idea to merge the functionality of the Media File Delete contrib module into Core.
- π¬π§United Kingdom AaronMcHale Edinburgh, Scotland
Big +1 from me.
I would have assumed that deleting a media entity would also delete the files that were uploaded into that entity, and I think that is probably what a lot of content editors and site builders would have expected.
Think about the workflow from the point of view of a content editor who receives a request to delete an image:
- We need to remove this image because (for instance) a person in it has withdrawn their consent.
- We go to the media library and delete the image (aka the media entity, but editors don't think in terms of entities they just think about the thing they are deleting).
- The editor think that's it done, they go back to the person and say that it's been deleted; But then, either: the editor check (just to be safe) and get confused when they find the image still actually exists, or they don't check and the person that originally requested the deletion sends a follow-up request asking why it was not actually deleted even though the editor said it was.
So, yes I'm 100% to this.
+1 from me, too. The lack of this functionality is really the only reason I'm hesitant about using Media for images. I don't want to accrue lots of orphan files over time.
- π¬π§United Kingdom catch
Broadly +1 to this too, but we also need to resolve π± Dealing with unexpected file deletion due to incorrect file usage Active . Potentially this could be the answer - make file deletion not automatic, but explicit and opt-in, and then assume that people aren't re-using the same file across media items and in other random places and deleting it without checking. Then just drop the entire file_usage system with no replacement.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Fwiw The current module doesn't show the option if file usage detects has a record of another usage
It also integrates with entity usage if that is available
- πΊπΈUnited States phenaproxima Massachusetts
+1 from me. This feels like table stakes for any file-based media type. I think deleting the associated file should be the default behavior; if it's not in the CMS, it doesn't make sense (from my own personal user perspective) for it to persist in the filesystem.