From cf0015d5075ba278d681b5776b2229516d0ce555 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 3 Aug 2022 17:01:07 +1200 Subject: [PATCH] Re-instate the contact->find() as tests expect it --- CRM/Contact/BAO/Contact.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index d51fd1e6e732..61f9bd7d0136 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -410,6 +410,13 @@ public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE // api calls may pass in skip_greeting_processing, probably doing it later via the // scheduled job. CRM-21551 if (empty($params['skip_greeting_processing'])) { + // This fetch has been historically been here & tests expect it as it affects + // the return array from the api. It could possibly be removed & tests updated to use 'get' + // the question is whether api + // consumers rely on it because it has worked before. + if ($contact->_query !== FALSE) { + $contact->find(TRUE); + } self::processGreetings($contact); }