CRM-16867 saving membership types is blocked when key for a renew type is present...
authorEileen McNaughton <eileen@fuzion.co.nz>
Sun, 19 Jul 2015 10:24:25 +0000 (22:24 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Sun, 19 Jul 2015 10:24:25 +0000 (22:24 +1200)
CRM/Member/Form/MembershipBlock.php

index 1103a7552427eed9fdadb304b65c77b5c8808b1c..33bdb359fe78ac1cf6d1ecea5613e431bfbf241c 100644 (file)
@@ -302,8 +302,8 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
             $errors['is_separate_payment'] = ts('You need to enable Separate Membership Payment when online contribution page is configured for both Membership and Recurring Contribution');
           }
           elseif (!empty($params['is_separate_payment'])) {
-            foreach ($params['membership_type'] as $mt => $dontCare) {
-              if (!empty($params["auto_renew_$mt"])) {
+            foreach ($params['membership_type'] as $mt => $isEnabled) {
+              if (!empty($params["auto_renew_$mt"]) && $isEnabled) {
                 $errors["auto_renew_$mt"] = ts('You cannot enable both Recurring Contributions and Auto-renew memberships on the same online contribution page');
                 break;
               }