Guest User

Untitled

a guest
May 27th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Index: core/model/DataObject.php
  2. ===================================================================
  3. --- core/model/DataObject.php (revision 106031)
  4. +++ core/model/DataObject.php (working copy)
  5. @@ -1122,6 +1122,9 @@
  6. user_error("$this->class has a broken onBeforeDelete() function. Make sure that you call parent::onBeforeDelete().", E_USER_ERROR);
  7. }
  8.  
  9. + // Deleting a record without an ID shouldn't do anything
  10. + if(!$this->ID) throw new Exception("DataObject::delete() called on a DataObject without an ID");
  11. +
  12. foreach($this->getClassAncestry() as $ancestor) {
  13. if(self::has_own_table($ancestor)) {
  14. $sql = new SQLQuery();
Add Comment
Please, Sign In to add comment