From d342c43c73e4996fd6c13ce48e85b65424483716 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Wed, 28 Jan 2015 15:16:20 -0500 Subject: [PATCH] CRM-15882 - ensure duplicate addresses are merged not overwritten when doing batch merge - different addresses should be preserved or a conflict should be generated. ---------------------------------------- * CRM-15882: batch merge overwrites addresses rather than try to preserve them https://issues.civicrm.org/jira/browse/CRM-15882 --- CRM/Dedupe/Merger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index c1a0226b91..0ac9cd1ad8 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -743,14 +743,14 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // Rule: resolve address conflict if any - if ($fieldName == 'address') { $mainNewLocTypeId = $migrationInfo['location'][$fieldName][$fieldCount]['locTypeId']; - if (!empty($migrationInfo['main_loc_address']) && - array_key_exists("main_{$mainNewLocTypeId}", $migrationInfo['main_loc_address'])) { + if (!empty($migrationInfo['main_loc_block']) && + array_key_exists("main_address{$mainNewLocTypeId}", $migrationInfo['main_loc_block'])) { // main loc already has some address for the loc-type. Its a overwrite situation. // look for next available loc-type $newTypeId = NULL; foreach ($allLocationTypes as $typeId => $typeLabel) { - if (!array_key_exists("main_{$typeId}", $migrationInfo['main_loc_address'])) { + if (!array_key_exists("main_address{$typeId}", $migrationInfo['main_loc_block'])) { $newTypeId = $typeId; } } -- 2.25.1