- Merge request !7Issue #3115158: Add functionality to immediately delete files and override usage check β (Closed) created by hswong3i
- Merge request !8#3115158 Add functionality to immediately delete files and override usage check β (Open) created by dharizza
- π³πΏ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...
- πΊπΈUnited States smustgrave
Fixes should be in MRs but the major functionality of this module is actually in core.
- Merge request !15Issue #3115158 by dantonmariano, andy_w, joseph.olstad, spencer95@gmail.com,... β (Merged) created by joseph.olstad
- π¨π¦Canada joseph.olstad
MR 8 should be closed.
I've pushed up MR 15 for 3.0.xI'll push up MR 16 for 2.0.x
- π¨π¦Canada joseph.olstad
joseph.olstad β changed the visibility of the branch 3115158-instant-delete2x to hidden.
- π¨π¦Canada joseph.olstad
joseph.olstad β changed the visibility of the branch 3115158-instant-delete to hidden.
- π¨π¦Canada joseph.olstad
For those using 2.0.x here's a patch:
https://www.drupal.org/files/issues/2024-04-27/3115158-instant-delete-in... β
For those using 3.0.x, here's the MR patch:
https://git.drupalcode.org/project/file_delete/-/merge_requests/15.patch
alternatively:
https://git.drupalcode.org/project/file_delete/-/merge_requests/15.diff - πΊπΈUnited States smustgrave
So of the 3 new settings think I'm fine with 2
The ability to delete associating media seems to be a reverse of http://drupal.org/project/media_file_delete. Also it ties this module to media when it previously wasn't.
I reverted those changes, maybe can move that other setting to another issue but relatively not for it. If we do add this functionality though I will mark the module no longer obsolete since it's adding to the core functionality.
Also added an update hook, if this all looks good I'll merge.
- πΊπΈUnited States smustgrave
Rebased after merging in π Extend the File EntityAccessHandler - Security Hardening Active which essentially removes all the stuff that we don't need now that file deletion is in core.
- π¨π¦Canada joseph.olstad
Hmm, ok 45 didn't work for me using the 3.0.x-dev, use 46 instead, it applies
-
smustgrave β
committed 98b2b0ad on 3.0.x authored by
joseph.olstad β
Issue #3115158 by dantonmariano, andy_w, joseph.olstad, spencer95@gmail....
-
smustgrave β
committed 98b2b0ad on 3.0.x authored by
joseph.olstad β
- π¨π¦Canada joseph.olstad
Thanks, please tag a 3.0.0/rc/beta/alpha at your earliest convenience.
Automatically closed - issue fixed for 2 weeks with no activity.