Skip to content

Commit

Permalink
Merge pull request #15595 from eileenmcnaughton/dedupe3
Browse files Browse the repository at this point in the history
dev/core#1339 Dedupe screen check to carry across any data where the other contact has none by default.
  • Loading branch information
seamuslee001 authored Nov 7, 2019
2 parents b526194 + 3d1d395 commit a633b17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CRM/Contact/Form/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ public function preProcess() {
// @todo consider enabling if it is an add & defaulting to true.
$element[4] = array_merge((array) CRM_Utils_Array::value(4, $element, []), ['disabled' => TRUE]);
}
$this->addElement($element[0],
$newCheckBox = $this->addElement($element[0],
$element[1],
array_key_exists('2', $element) ? $element[2] : NULL,
array_key_exists('3', $element) ? $element[3] : NULL,
array_key_exists('4', $element) ? $element[4] : NULL,
array_key_exists('5', $element) ? $element[5] : NULL
);
if (!empty($element['is_checked'])) {
$newCheckBox->setChecked(TRUE);
}
}

// add related table elements
Expand Down
13 changes: 7 additions & 6 deletions CRM/Dedupe/Merger.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,13 @@ public static function getRowsElementsAndInfo($mainId, $otherId, $checkPermissio
// Display a checkbox to migrate, only if the values are different
if ($value != $main[$field]) {
$elements[] = [
'advcheckbox',
"move_$field",
NULL,
NULL,
NULL,
$value,
0 => 'advcheckbox',
1 => "move_$field",
2 => NULL,
3 => NULL,
4 => NULL,
5 => $value,
'is_checked' => (!isset($main[$field]) || $main[$field] === ''),
];
}

Expand Down

0 comments on commit a633b17

Please sign in to comment.