diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index d75062a474b6..8c1246901539 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -2125,9 +2125,12 @@ public static function setQuickConfigMembershipParameters($membershipOrg, $membe */ protected static function updateDeceasedMembersStatuses() { $count = 0; + + $deceasedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', 'Deceased'); + // 'create' context for buildOptions returns only if enabled. $allStatus = self::buildOptions('status_id', 'create'); - if (($deceasedStatusId = array_search('Deceased', $allStatus)) === FALSE) { + if (array_key_exists($deceasedStatusId, $allStatus) === FALSE) { // Deceased status is an admin status & is required. We want to fail early if // it is not present or active. // We could make the case 'some databases just don't use deceased so we will check