Fix Smarty3 notices on merge screen
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 28 Nov 2023 09:22:54 +0000 (22:22 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 28 Nov 2023 09:25:32 +0000 (22:25 +1300)
CRM/Contact/Form/Merge.php
CRM/Dedupe/Merger.php
templates/CRM/Contact/Form/Merge.tpl

index c59df6e82f6f2ebb2ac9a27687a20b2467e8d9b1..95c12ffaf3463f7000f90f4c5fe78993097950f4 100644 (file)
@@ -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);
index 08852897a8154a04b41d690c9016efee22193df9..e567439dfcc6eb2d5e63f46d13f43586c09f9811 100644 (file)
@@ -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...
index 772881743170a6d853f7298e08f9af550ed398a2..ef79bdc7eb93393be38db304cbcd9cf0991a9b87 100644 (file)
             {$row.title|escape}
           </td>
         {/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}
 
           <td>
             {* @TODO check if this is ever an array or a fileName? *}