I am trying to build a simple hierarchy of two node types. A-type is the parent and B-type is the child. I am also trying to strictly enforce that hierarchy, i.e.:
1) a B-node cannot be created without specifying a parent A-node
2) when an A-node is deleted, all child B-nodes MUST be deleted (with an appropriate warning of course)

I added a nodereference field to my B-type that references the A-type and made that fileld mandatory. This automatically solves my 1st requirement. My questions is: how to enforce my 2nd requirement to delete all referencing child nodes when a referenced parent node is deleted? I searched long but couldn't find a module that does that. What is the best way to accomplish this? Any modules/code snippets?

Thanks!

Comments

kirilius’s picture

Any comments, ideas? Thanks!

kirilius’s picture

Up!

rar’s picture

Would be nice. See http://drupal.org/node/175556 for other discussions.

markus_petrux’s picture

Status: Active » Closed (duplicate)

This is the oldest issue I've found on the subject: #83929: referential integrity