[REF] Remove unreachable code
authoreileen <emcnaughton@wikimedia.org>
Mon, 28 Dec 2020 23:13:41 +0000 (12:13 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 28 Dec 2020 23:13:41 +0000 (12:13 +1300)
This code was copied from the previously shared function & supports some really weird stuff for the contribution form.

I tested & was unable to reach this from the back office membership form - note it is only reachable
when processing recurring which in turn relies on the membership type being configured and the
processor. It seems that recurring is not available with price sets

CRM/Member/Form/Membership.php

index 3fcf805c3b9f1340b97fd3a82ed7db264b6fd585..a8030975f02d04c408b668cba6ee1c5c0a2ad143 100644 (file)
@@ -1980,19 +1980,6 @@ DESC limit 1");
     $recurParams['currency'] = $params['currency'] ?? NULL;
     $recurParams['payment_instrument_id'] = $params['payment_instrument_id'];
 
-    // CRM-14354: For an auto-renewing membership with an additional contribution,
-    // if separate payments is not enabled, make sure only the membership fee recurs
-    if (!empty($form->_membershipBlock)
-      && $form->_membershipBlock['is_separate_payment'] === '0'
-      && isset($params['selectMembership'])
-      && $form->_values['is_allow_other_amount'] == '1'
-      // CRM-16331
-      && !empty($form->_membershipTypeValues)
-      && !empty($form->_membershipTypeValues[$params['selectMembership']]['minimum_fee'])
-    ) {
-      $recurParams['amount'] = $form->_membershipTypeValues[$params['selectMembership']]['minimum_fee'];
-    }
-
     $recurParams['is_test'] = 0;
     if (($form->_action & CRM_Core_Action::PREVIEW) ||
       (isset($form->_mode) && ($form->_mode == 'test'))