X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FDedupe%2FMerger.php;h=a49f15c5467dcf1399bd0f11d9e25204875eabc8;hb=ee9c028679b097f6f7e92f367a6cb8da3fd54037;hp=45f520e7996e12b417d9ed42701e73586b7db578;hpb=ff7da3a6508d0a7059c6527216920b2efb896b93;p=civicrm-core.git diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 45f520e799..a49f15c546 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -28,7 +28,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ @@ -156,7 +156,7 @@ class CRM_Dedupe_Merger { } /** - * Returns the related tables groups for which a contact has any info entered + * Returns the related tables groups for which a contact has any info entered. */ public static function getActiveRelTables($cid) { $cid = (int) $cid; @@ -243,7 +243,7 @@ WHERE } /** - * Return tables using locations + * Return tables using locations. */ public static function locTables() { static $locTables; @@ -645,7 +645,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // Generate var $migrationInfo. The variable structure is exactly same as // $formValues submitted during a UI merge for a pair of contacts. - $rowsElementsAndInfo = &CRM_Dedupe_Merger::getRowsElementsAndInfo($mainId, $otherId); + $rowsElementsAndInfo = CRM_Dedupe_Merger::getRowsElementsAndInfo($mainId, $otherId); $migrationInfo = &$rowsElementsAndInfo['migration_info']; @@ -658,10 +658,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // go ahead with merge if there is no conflict if (!CRM_Dedupe_Merger::skipMerge($mainId, $otherId, $migrationInfo, $mode)) { CRM_Dedupe_Merger::moveAllBelongings($mainId, $otherId, $migrationInfo); - $resultStats['merged'][] = array('main_d' => $mainId, 'other_id' => $otherId); + $resultStats['merged'][] = array('main_id' => $mainId, 'other_id' => $otherId); } else { - $resultStats['skipped'][] = array('main_d' => $mainId, 'other_id' => $otherId); + $resultStats['skipped'][] = array('main_id' => $mainId, 'other_id' => $otherId); } // delete entry from PrevNextCache table so we don't consider the pair next time @@ -746,15 +746,13 @@ 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; } }