Further recent regression fix
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 23 Oct 2023 23:03:01 +0000 (12:03 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 23 Oct 2023 23:58:52 +0000 (12:58 +1300)
CRM/Financial/BAO/Order.php

index 7f05c741c3fcea56f8d68c4863e2adb481813ba7..80ef1d33d2fdfbd2b541765caac41ed5ba66949d 100644 (file)
@@ -683,10 +683,10 @@ class CRM_Financial_BAO_Order {
           if (!empty($option['membership_type_id'])) {
             $membershipType = CRM_Member_BAO_MembershipType::getMembershipType((int) $option['membership_type_id']);
             $metadata[$index]['options'][$optionID]['auto_renew'] = (int) $membershipType['auto_renew'];
-            if ($membershipType['auto_renew'] && empty($this->priceSetMetadata['auto_renew_membership_type'])) {
+            if ($membershipType['auto_renew'] && empty($this->priceSetMetadata['auto_renew_membership_field'])) {
               // Quick form layer supports one auto-renew membership type per price set. If we
               // want more for any reason we can add another array property.
-              $this->priceSetMetadata['auto_renew_membership_type'] = (int) $option['membership_type_id'];
+              $this->priceSetMetadata['auto_renew_membership_field'] = (int) $option['membership_type_id'];
             }
           }
         }
@@ -711,6 +711,7 @@ class CRM_Financial_BAO_Order {
     if (empty($this->priceSetMetadata)) {
       $this->priceSetMetadata = CRM_Price_BAO_PriceSet::getCachedPriceSetDetail($this->getPriceSetID());
       $this->priceSetMetadata['id'] = $this->getPriceSetID();
+      $this->priceSetMetadata['auto_renew_membership_field'] = NULL;
       $this->setPriceFieldMetadata($this->priceSetMetadata['fields']);
       unset($this->priceSetMetadata['fields']);
     }