RooPostTrait.php
authorAlan Knowles <alan@roojs.com>
Fri, 17 Jun 2016 04:46:58 +0000 (12:46 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 17 Jun 2016 04:46:58 +0000 (12:46 +0800)
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) )  {