From: Seamus Lee Date: Tue, 23 Jan 2024 04:55:01 +0000 (+1100) Subject: Fix Checking Auto renew for Non Quick Config Price Set when Membership Type Auto... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c028d757abe7b827d342c5466ea12f318c9cce91;p=civicrm-core.git Fix Checking Auto renew for Non Quick Config Price Set when Membership Type Auto renew is null --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 8b5544e590..a39d1b0665 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1852,9 +1852,9 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu return 0; } if (!$this->isQuickConfig()) { - return CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeID)['auto_renew']; + return CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeID)['auto_renew'] ?? 0; } - $membershipTypeAutoRenewOption = CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeID)['auto_renew']; + $membershipTypeAutoRenewOption = CRM_Member_BAO_MembershipType::getMembershipType($membershipTypeID)['auto_renew'] ?? 0; if ($membershipTypeAutoRenewOption === 2 || $membershipTypeAutoRenewOption === 0) { // It is not possible to override never or always at the membership block leve. return $membershipTypeAutoRenewOption;