RooPostTrait.php
[Pman.Core] / RooPostTrait.php
index aae1fa2..f48c96d 100644 (file)
@@ -284,10 +284,6 @@ trait Pman_Core_RooPostTrait {
             
             $this->addDeleteEvent($x);
             
-            DB_DataObject::Factory('Events')->logDeletedRecord($x);
-            
-            $this->addEvent("DELETE", $x);
-            
             $xx->delete();
             
             if (method_exists($xx,'onDelete')) {
@@ -303,6 +299,17 @@ trait Pman_Core_RooPostTrait {
         
     }
     
+    function addDeleteEvent($object)
+    {
+        
+        DB_DataObject::Factory('Events')->logDeletedRecord($object);
+        
+        $this->addEvent("DELETE", $object);
+          
+        
+    }
+    
+    
     function update($x, $req,  $with_perm_check = true)
     {
         if ( $with_perm_check && !$this->checkPerm($x,'E', $req) )  {