From 5b0f2a6f202a64f2c7ac53cfe50375a79d0b55f3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 28 Nov 2023 22:22:54 +1300 Subject: [PATCH] Fix Smarty3 notices on merge screen --- CRM/Contact/Form/Merge.php | 1 + CRM/Dedupe/Merger.php | 1 + templates/CRM/Contact/Form/Merge.tpl | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index c59df6e82f..95c12ffaf3 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -200,6 +200,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { 'main' => NULL, 'other' => NULL, 'location_entity' => NULL, + 'location_block_index' => NULL, ]; } $this->assign('rows', $assignedRows); diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 08852897a8..e567439dfc 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -2945,6 +2945,7 @@ ORDER BY civicrm_custom_group.weight, // Add this value to the table rows $rows["move_location_{$blockName}_{$count}"]['other'] = $displayValue; $rows["move_location_{$blockName}_{$count}"]['location_entity'] = $blockName; + $rows["move_location_{$blockName}_{$count}"]['location_block_index'] = $count; // CRM-17556 Only display 'main' contact value if it's the same location + type // Look it up from main values... diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index 7728817431..ef79bdc7eb 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -90,10 +90,8 @@ {$row.title|escape} {/if} - - {assign var=position value=$field|strrpos:'_'} - {assign var=blockId value=$field|substr:$position+1} - {assign var=blockName value=$field|substr:14:$position-14} + {assign var=blockId value=$row.location_block_index} + {assign var=blockName value=$row.location_entity} {* @TODO check if this is ever an array or a fileName? *} -- 2.25.1