diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 0d586e08ad19..3a2e5f7716ad 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -138,6 +138,9 @@ public static function add(&$params) { } $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; diff --git a/CRM/Contact/BAO/Individual.php b/CRM/Contact/BAO/Individual.php index af28e7a244d5..cf18a557b88e 100644 --- a/CRM/Contact/BAO/Individual.php +++ b/CRM/Contact/BAO/Individual.php @@ -67,8 +67,6 @@ public static function format(&$params, &$contact) { $params['individual_suffix'] = $suffix = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', 'suffix_id', $suffix_id); } - $params['is_deceased'] = CRM_Utils_Array::value('is_deceased', $params, FALSE); - $individual = NULL; if ($contact->id) { $individual = new CRM_Contact_BAO_Contact();