- 🇳🇿New Zealand magunz
I have modified the #25 to implement a 3rd option to delete ALL the related / referring "Media Entities" too.
- 🇬🇧United Kingdom kiwimind
Having added the patch from #26, there are a couple of warnings showing.
Warning: Undefined array key "file" in Drupal\file_delete\Form\FileDeleteForm->submitForm() (line 167 of modules/contrib/file_delete/src/Form/FileDeleteForm.php).
Warning: foreach() argument must be of type array|object, null given in Drupal\file_delete\Form\FileDeleteForm->submitForm() (line 167 of modules/contrib/file_delete/src/Form/FileDeleteForm.php).
I can't see any reason (yet) why some files cause this and others don't, but thought I'd mention it.
- 🇬🇧United Kingdom kiwimind
Have amended the previous patch to include an extra check to avoid the warning, as well as a little code style clean up and amending the text being output about the reference being deleted.
I'm not 100% sure on whether
$usage['file']
is enough or whether we should be looking at what else is passed, e.g.$usage['editor']
, however this does remove the warning. - 🇨🇭Switzerland ayalon
Thanks for the updated patch. I was not able to apply it via composer agains 2.0.0. So I have created a rerolled version that applies.
- 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
The option "Do you want to delete the referring media entities?" is misleading and should be renamed for something more like
"Do you want to delete the referring entities?". If a node was referring that file then it would be deleted and it's not a media. - 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
Changed misleading option that delete all entity types, not only media.
Patch #29 doesn't apply towards the dev branch, so the interdiff is with #28
- 🇫🇷France flocondetoile Lyon
Patchs 26 and above are wrong because the ymiss the FileDeleteSettingsForm Class.
InvalidArgumentException: Class "\Drupal\file_delete\Form\FileDeleteSettingsForm" does not exist.
Nevermind I think we should go with MR8 (or patch 25), and discuss about this third option about deleting referencing entities in another dedicated issue. Consequences are potentially hugh, it's not only deleting media referencing the file deleted, but also any other content entities which reference this file (node, term, etc.) in any of its field.
- 🇫🇷France flocondetoile Lyon
Still having error "InvalidArgumentException: Class "\Drupal\file_delete\Form\FileDeleteSettingsForm" does not exist." with MR8. Investigating. I don't understand the Class form is well here and the namespace is correct and there is no typo...