Skip to content

Commit

Permalink
Merge pull request #23521 from eileenmcnaughton/dead
Browse files Browse the repository at this point in the history
Ensure setting deceased date sets is_deceased in the BAO
  • Loading branch information
yashodha authored May 20, 2022
2 parents 72920ca + 20fd45a commit 45e2237
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions CRM/Contact/BAO/Individual.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 45e2237

Please sign in to comment.