From 86b14b5914cd8966b7a878ec9f7599d5b41651b7 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 27 Mar 2019 15:07:02 +1300 Subject: [PATCH] Fix mis-formatting of Email greeting id, Address greeting id etc The formatting was inappropriately relying on the field's title in the IF clause. I added the location_entity to the row so it would no longer have to guess --- CRM/Dedupe/Merger.php | 1 + templates/CRM/Contact/Form/Merge.tpl | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 1c82527efb..228cb643cb 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1277,6 +1277,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m // Set this value as the default against the 'other' contact value $rows["move_location_{$blockName}_{$count}"]['main'] = $mainValueCheck[$blockInfo['displayField']]; $rows["move_location_{$blockName}_{$count}"]['main_is_primary'] = $mainValueCheck['is_primary']; + $rows["move_location_{$blockName}_{$count}"]['location_entity'] = $blockName; $mainContactBlockId = $mainValueCheck['id']; break; } diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index ec276ca7c7..750e7a5f60 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -114,8 +114,8 @@ {* @TODO check if this is ever an array or a fileName? *} - {if $row.title|substr:0:5 == "Email" OR - $row.title|substr:0:7 == "Address"} + {if $row.location_entity == "email" OR + $row.location_entity == "address"} {else} @@ -135,16 +135,12 @@ {* For location blocks *} - {if $row.title|substr:0:5 == "Email" OR - $row.title|substr:0:7 == "Address" OR - $row.title|substr:0:2 == "IM" OR - $row.title|substr:0:7 == "Website" OR - $row.title|substr:0:5 == "Phone"} + {if $row.location_entity} {strip} - {if $row.title|substr:0:5 == "Email" OR - $row.title|substr:0:7 == "Address"} + {if $row.location_entity == "email" OR + $row.location_entity == "address"} {else} -- 2.25.1