[eluser]OverZealous[/eluser]
[quote author="mcnux" date="1251469051"]Rubbish this is me. Completely forgot I had overridden delete() in an extension to allow for deleting after relationships are removed. Sorry my bad!![/quote]
Ach! If I drank, I'd say you owe me a beer. :-)
I've been staring at the code, and it's almost 5:30 in the morning here. :-P
I should mention that I think I found a different bug when deleting just the relationship for self-referencing, ITFK relationships. It only occurs if you delete the relationship from one side — meaning, deleting $parent->delete($child) might have the error, but $child->delete($parent) won't. (Or vice-versa, it depends on which object is the ITFK.)
I have a fix in place for that, but I'm not going to be able to get it out right away. The work around for now is to swap the items if you see the bug.