}
$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);
}
$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';