From c9709b426c1182ab078a10fd896640fc855a5e9a Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 3 Oct 2020 11:06:11 +1300 Subject: [PATCH] dev/core#2087 Remove extraneous CRM_Core_BAO_UFMatch::updateUFName call This is called from Email.create already (which is how this creates emails) - to be cautious an extra change ensures that if the primary email is deleled & another is promoted it is called --- CRM/Contact/BAO/Contact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 138b9569bb..d258641cb7 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -371,9 +371,6 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact { } } - // update the UF user_unique_id if that has changed - CRM_Core_BAO_UFMatch::updateUFName($contact->id); - if (!empty($params['custom']) && is_array($params['custom']) ) { @@ -3531,6 +3528,9 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id ) if ($dao->fetch()) { $dao->is_primary = 1; $dao->save(); + if ($type === 'Email') { + CRM_Core_BAO_UFMatch::updateUFName($dao->contact_id); + } } } } -- 2.25.1