From: priyankakaran26 Date: Sat, 18 Oct 2014 19:18:54 +0000 (+0100) Subject: account for is_multirecord for re-creating entries in recurring-entity table. Don... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=38e73dfaf2326213923e1047f65bb776bb33ed16;p=civicrm-core.git account for is_multirecord for re-creating entries in recurring-entity table. Don't bother doing anything with delete if its the linked entity itself --- diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index 8861cd7534..647ffbc0a2 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -112,7 +112,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { ), 'civicrm_uf_join' => array( 'entity_id_col' => 'entity_id', - 'entity_table_col' => 'entity_table' + 'entity_table_col' => 'entity_table', + 'is_multirecord' => TRUE, ), 'civicrm_pcp_block' => array( 'entity_id_col' => 'entity_id', @@ -630,7 +631,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { if (empty($hasaRecurringRecord)) { // check if its a linked entity - if (array_key_exists($obj->__table, self::$_linkedEntitiesInfo)) { + if (array_key_exists($obj->__table, self::$_linkedEntitiesInfo) && + !CRM_Utils_Array::value('is_multirecord', self::$_linkedEntitiesInfo[$obj->__table])) { $linkedDAO = new self::$_tableDAOMapper[$obj->__table](); $linkedDAO->id = $obj->id; if ($linkedDAO->find(TRUE)) { @@ -751,7 +753,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { $dao->entity_id = $entityId; $dao->entity_table = $entityTable; if ($dao->find(TRUE)) { - if ($isDelLinkedEntities) { + // make sure its not a linked entity thats being deleted + if ($isDelLinkedEntities && !array_key_exists($entityTable, self::$_linkedEntitiesInfo)) { // delete all linked entities from recurring entity table foreach (self::$_linkedEntitiesInfo as $linkedTable => $linfo) { $daoName = self::$_tableDAOMapper[$linkedTable];