Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
currently used in imceimage - it would be very useful to prevent the file from being deleted if it is being used. Would it be possible to add hooks called before image deletion or updates?
If hook returns an error - then do not delete the image and display error message to user?
thanks.
Comments
Comment #1
ufku CreditAttribution: ufku commentedI can review and commit any kindly provided patch with pleasure. This may even go into the current branch.
Comment #2
MiMe CreditAttribution: MiMe commentedI think this is in the dev alreay.
But... I would really like to see a fix that allow a user to delete the files of the current node that they are editing.
At the moment I must edit the node, remove the files from the node body, save the node, re-edit and browse for the files in IMCE and then delete them...
Comment #3
nmc CreditAttribution: nmc commentedFollowing up on this. I'm surprised there hasn't been more interest. Does anyone have a workaround that they're using?
Currently using v7.x-1.4 and not finding this feature as being already available. I can remove files being used by the current node while editing the current node (before saving any file removal) - resulting in broken links.
Comment #4
ufku CreditAttribution: ufku commentedIMCE respects file usage while deleting files. Note that, adding the file link into content body does not make it in use.
Comment #5
laur3ntlapo CreditAttribution: laur3ntlapo commentedIs there a way to make IMCE mark a file inserted in the body as being used in the file usage table?