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
Comment #1
kirilius CreditAttribution: kirilius commentedAny comments, ideas? Thanks!
Comment #2
kirilius CreditAttribution: kirilius commentedUp!
Comment #3
rar CreditAttribution: rar commentedWould be nice. See http://drupal.org/node/175556 for other discussions.
Comment #4
markus_petrux CreditAttribution: markus_petrux commentedThis is the oldest issue I've found on the subject: #83929: referential integrity