Hello
I have got a class called project
class project extends DataObject {
static $has_one = array {
'aFile' =>'MyFile'
}
public onBeforeDelete(){
parent::onBeforeDelete();
$this->aFile()->delete();
}
}
An the MyFile class is
MyFile extends File{
public onBeforeDelete(){
//do something
parent::OnBeforeDelete()
}
}
Problem:
When I delete a Project within the ModelAdmin, I got this error:
There has been an error
and I am not sure where to go from here. I check the log file and I got
[15-May-2012 02:03:15] Notice at d line d: d (/admin/projects/Project/3/EditForm?action_doDelete=Delete)
[15-May-2012 02:03:15] Error at sapphire/core/model/DataObject.php line 1126: Uncaught Exception: DataObject::delete() called on a DataObject without an ID