From c7966b2139863f0b43abe14fc21ecdd6408d994d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 28 Oct 2021 12:21:20 +1300 Subject: [PATCH] Don't make up test values for greeting ids as they are type specific --- CRM/Contact/BAO/Contact.php | 2 +- CRM/Core/DAO.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 5114fe563a..6ca6fe6607 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -541,7 +541,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Te // If we are setting it to null then null out the display field. $params[$greetingIndex . '_display'] = 'null'; } - if ((int) $params[$greetingParam] !== CRM_Core_PseudoConstant::getKey('CRM_Contact_BAO_Contact', $greetingParam, 'Customized')) { + if ((int) $params[$greetingParam] != CRM_Core_PseudoConstant::getKey('CRM_Contact_BAO_Contact', $greetingParam, 'Customized')) { $params[$greetingIndex . '_custom'] = 'null'; } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 2a375fbca1..9f6470a8d7 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -300,9 +300,9 @@ class CRM_Core_DAO extends DB_DataObject { $daoName = get_class($this); $handled = FALSE; - if (!$handled && $dbName == 'contact_sub_type') { - //coming up with a rule to set this is too complex let's not set it - $handled = TRUE; + if (in_array($dbName, ['contact_sub_type', 'email_greeting_id', 'postal_greeting_id', 'addressee_id'], TRUE)) { + //coming up with a rule to set these is too complex - skip + return; } // Pick an option value if needed -- 2.25.1