From: Aidan Saunders Date: Mon, 1 Dec 2014 18:07:01 +0000 (+0000) Subject: Avoid processing location tables when moveContactBelongings() is called without a... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9da04f2099ada4c481d3ff576e4a7d9004563465;p=civicrm-core.git Avoid processing location tables when moveContactBelongings() is called without a table list since these are handled separately. Issue CRM-15658 --- diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 7057ad3555..c1a0226b91 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -242,6 +242,20 @@ WHERE return $eidRefs; } + /** + * Return tables using locations + */ + static function locTables() { + static $locTables; + if (!$locTables) { + $locTables = array( 'civicrm_email', 'civicrm_address', 'civicrm_phone' ); + + // Allow hook_civicrm_merge() to adjust $locTables + CRM_Utils_Hook::merge('locTables', $locTables); + } + return $locTables; + } + /** * We treat multi-valued custom sets as "related tables" similar to activities, contributions, etc. * @param string $request 'relTables' or 'cidRefs' @@ -416,8 +430,9 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m } else { // if there aren't any specific tables, don't affect the ones handled by relTables() + // also don't affect tables in locTables() CRM-15658 $relTables = self::relTables(); - $handled = array(); + $handled = self::locTables(); foreach ($relTables as $params) { $handled = array_merge($handled, $params['tables']); }