Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Move handling of form elements back to the Form #17981

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CRM/Contact/Form/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
7 changes: 1 addition & 6 deletions CRM/Dedupe/Merger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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,
Expand Down