From c028d757abe7b827d342c5466ea12f318c9cce91 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 23 Jan 2024 15:55:01 +1100 Subject: [PATCH] Fix Checking Auto renew for Non Quick Config Price Set when Membership Type Auto renew is null --- CRM/Contribute/Form/Contribution/Main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.25.1