From 2f43fd45d6bb537c611b473a8cd18529eb5a11d3 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 3 Oct 2020 11:07:37 +1300 Subject: [PATCH] dev/core#2087 move uf_match check above the primary check the uf_match check will result in an early return more often than the other --- CRM/Core/BAO/UFMatch.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index 9e61b990b3..9d0a58bbac 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -340,6 +340,14 @@ AND domain_id = %4 return; } + // 1.do check for contact Id. + $ufmatch = new CRM_Core_DAO_UFMatch(); + $ufmatch->contact_id = $contactId; + $ufmatch->domain_id = CRM_Core_Config::domainID(); + if (!$ufmatch->find(TRUE)) { + return; + } + $config = CRM_Core_Config::singleton(); $ufName = CRM_Contact_BAO_Contact::getPrimaryEmail($contactId); @@ -349,13 +357,6 @@ AND domain_id = %4 $update = FALSE; - // 1.do check for contact Id. - $ufmatch = new CRM_Core_DAO_UFMatch(); - $ufmatch->contact_id = $contactId; - $ufmatch->domain_id = CRM_Core_Config::domainID(); - if (!$ufmatch->find(TRUE)) { - return; - } if ($ufmatch->uf_name != $ufName) { $update = TRUE; } -- 2.25.1