Could this module perform this type of functionality?

http://plone.org/products/plone/features/3.0/new/link-and-reference-inte...

Instead of delete cascade and delete restrict (issue), how about simply prompting the user and let the user decide whether or not to delete the referenced nodes?

What do you think?

Comments

markus_petrux’s picture

Status: Active » Closed (won't fix)

This is kind of "Delete restrict" rule, but there is no reliable way to implement this in Drupal because any module could do node_delete() without asking permission, just that. There's no hook we can intercept to validate if a node delete operation can be done or not.

Node delete operations could be intercepted by... path, using hook_form_alter(), adding/altering functionality in VBO, admin content, etc. but there may be other modules deleting nodes in some other ways we could not track.

This is a complex task, and reliable only if you can be 100% sure all delete operations are intercepted, so I decided not to spend time on that, aside that we don't needed it.

There may be partial implementations of this feature, but I would not add them here, in this module. For example, you could hide the delete button in the node form if a you find relations to the node being edited. And things of that sort... but that's not 100% sure a referred node cannot be deleted if someone uses admin content, or any other method to delete nodes.