From 20fd45af27fc71cdc34847076d6eecdbc0807938 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 20 May 2022 19:48:07 +1200 Subject: [PATCH] Ensure setting deceased date sets is_deceased in the BAO --- CRM/Contact/BAO/Contact.php | 3 +++ CRM/Contact/BAO/Individual.php | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 0d586e08ad..3a2e5f7716 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -138,6 +138,9 @@ 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; diff --git a/CRM/Contact/BAO/Individual.php b/CRM/Contact/BAO/Individual.php index af28e7a244..cf18a557b8 100644 --- a/CRM/Contact/BAO/Individual.php +++ b/CRM/Contact/BAO/Individual.php @@ -67,8 +67,6 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_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(); -- 2.25.1