From f9a691269fa19af8ddd6d849955101e37f33e7a8 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 1 Dec 2021 11:39:38 +1300 Subject: [PATCH] [Smarty variables] remove isset from merge screen --- CRM/Contact/Form/Merge.php | 12 +++++++++++- templates/CRM/Contact/Form/Merge.tpl | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index a7394d6fdf..4ccd00c0b5 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -196,7 +196,17 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { unset($rowsElementsAndInfo['rows']['move_contact_type']); } - $this->assign('rows', $rowsElementsAndInfo['rows']); + $assignedRows = $rowsElementsAndInfo['rows']; + foreach ($assignedRows as $index => $assignedRow) { + // prevent smarty notices. + if (!array_key_exists('main', $assignedRow)) { + $assignedRows[$index]['main'] = NULL; + } + if (!array_key_exists('other', $assignedRow)) { + $assignedRows[$index]['other'] = NULL; + } + } + $this->assign('rows', $assignedRows); // add elements foreach ($rowsElementsAndInfo['elements'] as $element) { diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index dce608c1b8..28ca7fb156 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -75,7 +75,7 @@ {foreach from=$rows item=row key=field} - {if !isset($row.main) && !isset($row.other)} + {if !$row.main && !$row.other} {$row.title|escape} @@ -193,7 +193,7 @@ - {if isset($row.main) || isset($row.other)} + {if $row.main || $row.other} {if $row.main == $row.other} ({ts}match{/ts})
-- 2.25.1