Hi,
I can't seem to find a way to detect relationship additions/changes in onAfterWrite(). E.g. I have a DataObject which $has_one MyFile. When I test onAfterWrite() and look for $this->MyFileID after adding an object it shows the new ID. This is great, but I remove the MyFile, the ID doesn't revert to 0. Likewise $this->MyFile()->exists(), $this->MyFile() and $this->MyFile->ID all return old data, only after saving for second time do I get the current values. Furthermore, $this->getChangedFields() behaves like MyFileID, showing only addtions, not deletions.
Is this normal behaviour or do I have something wrong and the relation ID should be resetting to 0?
r9