Problem/Motivation
As discussed in #3164519: Drupal 8 cannot delete image, it show "XX.JPG is in use by another application", it is not possible to delete an image if it is being used by drupal. I had a look in the code and I see that
$ignore_usage = $fm->getConf('ignore_usage', FALSE); was already implemented but the feature was not totally ready to be used.
Proposed resolution
Finish the implementation, so site admins and site builders can manage if a user will be able to ignore the file usage when deleting it.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | imce-Enable_to_delete_file_even_if_drupal_is_using_it-3166956-5.patch | 2.18 KB | paulocs |
| #3 | imce-Enable_to_delete_file_even_if_drupal_is_using_it-3166956-3.patch | 2.09 KB | paulocs |
Comments
Comment #2
paulocsComment #3
paulocsFollow a patch.
Cheers, Paulo.
Comment #4
paulocsPatch needs re-roll.
I'll do it.
Comment #5
paulocsComment #6
paulocsComment #7
thallesLooks good to me!
Thanks @paulocs!
Comment #9
thallesComment #11
embeau commentedI was expecting this change to be included in the latest release (8.x-2.3), but it wasn't.
Tested with the dev branch and it works great! However, we do not want to use the dev branch on our prod site and I can't apply this patch to 2.2 or 2.3.
Any suggestions?
Thanks!
Comment #12
sxs551 commentedAgree with #11. Will this patch be included as part of a stable release anytime soon?
Comment #13
ufku commentedIt's in https://www.drupal.org/project/imce/releases/8.x-2.x-dev and will be in the next stable release.
Comment #14
namita21 commentedUnable to apply the patch for IMCE 2.3v, is there another workaround for this issue.
Comment #15
dqdHm, seems that this got lost in the later releases v2 and v3, so this actually should be re-opened. And re-implemented? Or some documentary or statement here should explain where to find this option or why it has not been implemented (sometimes such things happen for good reasons but should be documented somehwere).
Comment #16
dqdApart from #15, another thing I worry about is:
Is just an attempt to override the default config which disallows ignoring usage. But: I am not sure if this is enough to solve that underlying problem and it can possibly break the site if the image has other relations on the site which are not known yet. I wonder if this would cause things like, for example, keeping orphaned revision data of this image in the database, which could become a problem later. I wonder if this is enough to just note "pay attention" or if it rather should be seomthing more ringing like: "Be warned! This setting should only be used temporarely for chirurgical purposes, where an image won't allow to be deleted and you are sure it has definitely no usage or connection no more in the system. Make sure revisions are turned off for this image if it still exist in the content file or media overviews. Standard setting should be OFF here (recommended)."