X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FContact.php;h=1c5919312e9f952a44f94b5fcf7512e6d84367cc;hb=82cf8ae3440c01fa495ed8063dc0a47129155491;hp=0d586e08ad19fe3dd5383799663569254f5b40a8;hpb=19f33b0958e24b4ba68bc07d653a11aa6ca59bb4;p=civicrm-core.git diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 0d586e08ad..1c5919312e 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -138,15 +138,18 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Co } $params = array_merge($defaults, $params); + if (!empty($params['deceased_date']) && $params['deceased_date'] !== 'null') { + $params['is_deceased'] = TRUE; + } $allNull = $contact->copyValues($params); $contact->id = $contactID; if ($contact->contact_type === 'Individual') { $allNull = FALSE; - // @todo allow the lines below to be overridden by input or hooks & add tests, - // as has been done for households and organizations. - // Format individual fields. + // @todo get rid of this - most of this formatting should + // be done by time we get here - maybe start with some + // deprecation notices. CRM_Contact_BAO_Individual::format($params, $contact); } @@ -503,6 +506,9 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact implements Civi\Co $missingGreetingParams = []; foreach ($allGreetingParams as $greetingIndex => $greetingParam) { + if (!empty($params[$greetingIndex . '_custom']) && empty($params[$greetingParam])) { + $params[$greetingParam] = CRM_Core_PseudoConstant::getKey('CRM_Contact_BAO_Contact', $greetingParam, 'Customized'); + } // An empty string means NULL if (($params[$greetingParam] ?? NULL) === '') { $params[$greetingParam] = 'null';