always remove entity from civicrm_managed if we think it should be deleted
authorMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Mon, 23 Apr 2018 11:01:55 +0000 (12:01 +0100)
committerMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Wed, 23 May 2018 08:53:49 +0000 (09:53 +0100)
CRM/Core/ManagedEntities.php

index 5021859b01c0ef9a2cbabd1fa397aa7f369d5a34..1e55562c90d2a14209147bcb199538edd1c90b6f 100644 (file)
@@ -340,11 +340,10 @@ class CRM_Core_ManagedEntities {
         if ($result['is_error']) {
           $this->onApiError($dao->entity_type, 'delete', $params, $result);
         }
-
-        CRM_Core_DAO::executeQuery('DELETE FROM civicrm_managed WHERE id = %1', array(
-          1 => array($dao->id, 'Integer'),
-        ));
       }
+      CRM_Core_DAO::executeQuery('DELETE FROM civicrm_managed WHERE id = %1', array(
+        1 => array($dao->id, 'Integer'),
+      ));
     }
   }