dev/core#1088 Fix fatal error when copying profile with civirules enabled
authoreileen <emcnaughton@wikimedia.org>
Mon, 1 Jul 2019 11:53:10 +0000 (23:53 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 1 Jul 2019 11:55:44 +0000 (23:55 +1200)
Fixes a bug where the DAO name was not passed to the hook when copying a profile.

CRM/Core/DAO.php

index f4593a4bd57e7b6560cd0cc1e6176cbefd6280ce..e2adbc6f7e97f3477452e90e244ca2d676968acc 100644 (file)
@@ -1672,7 +1672,7 @@ FROM   civicrm_domain
       }
       $newObject->save();
       $newObject->copyCustomFields($object->id, $newObject->id);
-      CRM_Utils_Hook::post('create', CRM_Core_DAO_AllCoreTables::getBriefName($daoName), $newObject->id, $newObject);
+      CRM_Utils_Hook::post('create', CRM_Core_DAO_AllCoreTables::getBriefName(str_replace('_BAO_', '_DAO_', $daoName)), $newObject->id, $newObject);
     }
 
     return $newObject;