I am doing something pretty simple
public function onAfterWrite( ){
$pageID = $this->LinkPageID;
if($pageID){
$LinkedPage = Page::get()->filter(array('ID'=>$pageID))->first();
$LinkedPage->LinkPageID = $this->ID;
$LinkedPage->write();
parent::onAfterWrite();
}
}
I can see the update in the database so its working and sometimes it goes though just fine but most of the time the browser just hangs and then gets a 500 error. The fact that sometimes it works fine and that I can see the updates in the database has me boggled.