Skip to content

Commit

Permalink
Merge pull request #14146 from eileenmcnaughton/dedupe6
Browse files Browse the repository at this point in the history
dev/core#723 [REF] Declare contactType var rather than using long array syntax.
  • Loading branch information
seamuslee001 authored Apr 27, 2019
2 parents bec57c2 + 1acd98e commit 87497b2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CRM/Dedupe/Merger.php
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ public static function moveAllBelongings($mainId, $otherId, $migrationInfo, $che
return FALSE;
}

$contactType = $migrationInfo['main_details']['contact_type'];
$relTables = CRM_Dedupe_Merger::relTables();
$submittedCustomFields = $moveTables = $tableOperations = $removeTables = [];

Expand Down Expand Up @@ -1680,9 +1681,9 @@ public static function moveAllBelongings($mainId, $otherId, $migrationInfo, $che

// fix custom fields so they're edible by createProfileContact()
$treeCache = [];
if (!array_key_exists($migrationInfo['main_details']['contact_type'], $treeCache)) {
$treeCache[$migrationInfo['main_details']['contact_type']] = CRM_Core_BAO_CustomGroup::getTree(
$migrationInfo['main_details']['contact_type'],
if (!array_key_exists($contactType, $treeCache)) {
$treeCache[$contactType] = CRM_Core_BAO_CustomGroup::getTree(
$contactType,
NULL,
NULL,
-1,
Expand All @@ -1696,7 +1697,7 @@ public static function moveAllBelongings($mainId, $otherId, $migrationInfo, $che
}

$cFields = [];
foreach ($treeCache[$migrationInfo['main_details']['contact_type']] as $key => $group) {
foreach ($treeCache[$contactType] as $key => $group) {
if (!isset($group['fields'])) {
continue;
}
Expand Down

0 comments on commit 87497b2

Please sign in to comment.