Open ahonor opened 12 years ago
Actually, it appears it is not possible to delete a NodeType from the GUI as well.
A flash message appears when trying to delete: "NodeType 5 could not be deleted"
Note, this is true even for types that have no Node instances.
Further investigation shows that any NodeType that has associated TemplateAttributes cannot be deleted. (i.e., a NodeType w/o associated attributes can be deleted).
Yes you have to delete associations unless you want an unchecked cascade,... which is dangerous. I can put in more CLEAR error messages if this is what you want but this needs to be specified as to whether the CASCADE DELETE with transactional rollback is wanted or whether CLEARER OUTPUT MESSAGES are or both. At which point this will most likely be all I do today.
what needs to be done is make sure their is no 'dependson' between node and nodetype so all you have to do is CHECK whether a node nodetype exists in a node or not up front (outside the transaction); this is our main test and needs to happen upfront and outside the transaction as it is easier and doesnt need to happen within transaction since we would never commit this regardless if it existed. Then do a transactional delete through the dependencies (nodetype > templateattribute > templatevalue) and rollback on any fail.
To reproduce:
Response: