Problem/Motivation

File usage is not being counted by drupal core (at this time) 8.8.12 release and 8.9.10 and 9.0.x for wysiwyg embedded images
So safedelete would like to help.

Steps to reproduce

embed a media item using the wysiwyg editor and the media browser entity embed
save the node
check the file_usage
no change

Proposed resolution

embed a media item using the wysiwyg editor and the media browser entity embed
save the node
check the file_usage
adding media will now increment
removing media or deleting node will decrement file usage for media with file

Remaining tasks

review commit

Comments

joseph.olstad created an issue. See original summary.

jamesyao’s picture

Added the custom file usage handler to manage the file usage when the user inserts the file through Media library.

data-entity-type="media" data-entity-uuid="([a-z]|[0-9]){8}-(([0-9]|[a-z]){4}-){3}([0-9]|[a-z]){12}";

joseph.olstad’s picture

Status: Active » Fixed

Thanks jamesYa0, great work!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.