diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 0f68d5a057c2..fb6f6bddf12c 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -229,8 +229,8 @@ public function preProcess() { } // add related table elements - foreach ($rowsElementsAndInfo['rel_table_elements'] as $relTableElement) { - $element = $this->addElement($relTableElement[0], $relTableElement[1]); + foreach (array_keys($rowsElementsAndInfo['rel_tables']) as $relTableElement) { + $element = $this->addElement('checkbox', $relTableElement); $element->setChecked(TRUE); } diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 1a918695103c..0bab319abba7 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1097,9 +1097,6 @@ public static function getLocationBlockInfo() { * * elements => An array of form elements for the merge UI * - * rel_table_elements => An array of form elements for the merge UI for - * entities related to the contact (eg: checkbox to move 'mailings') - * * rel_tables => Stores the tables that have related entities for the contact * for example mailings, groups * @@ -1129,7 +1126,7 @@ public static function getRowsElementsAndInfo($mainId, $otherId, $checkPermissio $compareFields = self::retrieveFields($main, $other); - $rows = $elements = $relTableElements = $migrationInfo = []; + $rows = $elements = $migrationInfo = []; foreach ($compareFields['contact'] as $field) { if ($field === 'contact_sub_type') { @@ -1186,7 +1183,6 @@ public static function getRowsElementsAndInfo($mainId, $otherId, $checkPermissio $mergeHandler = new CRM_Dedupe_MergeHandler((int) $mainId, (int) $otherId); $relTables = $mergeHandler->getTablesRelatedToTheMergePair(); foreach ($relTables as $name => $null) { - $relTableElements[] = ['checkbox', "move_$name"]; $migrationInfo["move_$name"] = 1; $relTables[$name]['main_url'] = str_replace('$cid', $mainId, $relTables[$name]['url']); @@ -1274,7 +1270,6 @@ public static function getRowsElementsAndInfo($mainId, $otherId, $checkPermissio $result = [ 'rows' => $rows, 'elements' => $elements, - 'rel_table_elements' => $relTableElements, 'rel_tables' => $relTables, 'main_details' => $main, 'other_details' => $other,