Fix Checking Auto renew for Non Quick Config Price Set when Membership Type Auto...
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 23 Jan 2024 04:55:01 +0000 (15:55 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 23 Jan 2024 04:59:08 +0000 (15:59 +1100)
CRM/Contribute/Form/Contribution/Main.php

index 8b5544e590f0b295bec7c9d31ea97d663159ca37..a39d1b06656e5b7229d272cd3cb86b4fc93d7cb7 100644 (file)
@@ -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;