From 474651be8ae19a7b5ef9ca880829afff65c7a26a Mon Sep 17 00:00:00 2001 From: Noah Miller Date: Wed, 8 Mar 2023 22:43:09 -0500 Subject: [PATCH] Smarty notice fix on Merge --- CRM/Dedupe/Merger.php | 3 +++ templates/CRM/Contact/Form/Merge.tpl | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 7e1b2446be..669ec64c95 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1576,6 +1576,8 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $relTables[$name]['main_url'] = str_replace('$cid', $mainId, $relTables[$name]['url']); $relTables[$name]['other_url'] = str_replace('$cid', $otherId, $relTables[$name]['url']); + $relTables[$name]['has_operation'] = 0; + if ($name === 'rel_table_users') { // @todo - this user url stuff is only needed for the form layer - move to CRM_Contact_Form_Merge $relTables[$name]['main_url'] = str_replace('%ufid', CRM_Core_BAO_UFMatch::getUFId($mainId), $relTables[$name]['url']); @@ -1599,6 +1601,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $attributes, ]; $migrationInfo["operation"]["move_{$name}"]['add'] = 1; + $relTables[$name]['has_operation'] = 1; } } foreach ($relTables as $name => $null) { diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index e7cf5c32ad..45b96032b7 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -114,7 +114,7 @@ - {if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==>{/if} + {if array_key_exists($field, $form) && $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==>{/if} {* For location blocks *} @@ -219,7 +219,7 @@ {else} - {ts}Move related...{/ts}{$params.title}=={$form.$paramName.html|crmAddClass:"select-row"}==>{$params.title}{if $form.operation.$paramName.add.html} {$form.operation.$paramName.add.html}{/if} + {ts}Move related...{/ts}{$params.title}=={$form.$paramName.html|crmAddClass:"select-row"}==>{$params.title}{if $params.has_operation} {$form.operation.$paramName.add.html}{/if} ({ts}migrate{/ts}) {/if} -- 2.25.1