This is a follow-up to #2378327: Referenced entities can be deleted. In that issue, we added some protections against deleting entities that are referenced by other entities (ie: you can't delete an asset that has logs referencing it). You first have to delete all entities that reference it, then you can delete the original entity.

In some cases, you may be faced with a rather tedious cleanup process. Imagine a future feature that auto-generates a bunch of assets and logs, and then you decide you want to delete some of the assets that were created. You would have to go through and delete all their logs first, and then delete the assets.

This feature request is to build a "cascading entity deletion" feature - that allows you to give the system permission to delete entities AND any entities that reference them. Or perhaps some other options for more nuanced cleanup.

Comments #10 and #12 in the issue linked above have some ideas for these features:

https://www.drupal.org/project/farm/issues/2378327#comment-12162977

https://www.drupal.org/project/farm/issues/2378327#comment-12163553

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Status: Active » Closed (won't fix)

Closing this as "won't fix". There hasn't been a need for a general solution to this and in general this just feels dangerous to me.

If this is needed for specific use-cases, it can be handled there (like we are doing in the Crop Plan module to delete seedings/transplantings when a planting is deleted.