Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Release: Mautic Audiences 1.1.5 — Minor update available for module mautic_audiences (1.1.5). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: RightUp 1.0.2 — Minor update available for module rightup (1.0.2). Release: CronWatch 0.12.1 — Minor update available for module cronwatch (0.12.1). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

Core did not support a delete_ui (see #2949017: There is no way to delete file entities of other users) before 10.1. Since that issue has merged, this module is no longer necessary after 10.1.

This module adds the capability to delete files from the file admin view (UI). It assumes that the admin knows what they are doing and trusts that when they want to delete a file (even one with a non zero usage count) that they really want to remove the file. When removing files that are referenced by other entities, core takes care of removing the reference.

This capability was previously provided by file_entity but when media went into core in Drupal 8.4, file_entity was no longer recommended (read the project page). We can delete media entities but we can't actually delete files.

The general philosophy seems to be that files are not first class entities, that they are always attached to something, and that they only get deleted when that something is deleted. However, because of various bugs in core (see #2821423: Dealing with unexpected file deletion due to incorrect file usage, automatic file deletion was removed (see #2891902: Files that have no remaining usages are no longer deleted by default). So we no longer delete files that are in use. But we also have no way for an admin to remove files that they know are not in use.

This modules recreates the minimal parts from file_entity module to provide delete access and an admin UI by doing the following:

  • adds an admin permission to 'delete any file'
  • ensures that the file entity supports delete by adding the core entity delete template; this allows core to add an entity operations field
  • adds the entity operations field to the file admin view; this is done as configuration, so it can easily change it to the 'delete' link if you prefer.

There are several contrib solutions, none do exactly what this module does:

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jan 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.0-beta3 Pre-release Jul 13, 2023
1.0.0-beta2 Pre-release Jan 16, 2023
1.0.0-beta1 Pre-release Jan 14, 2023