+
+ // Fix for CRM-14354. If the membership is recurring, don't create a
+ // civicrm_contribution_recur record for the additional contribution
+ // (i.e., the amount NOT associated with the membership). Temporarily
+ // cache the is_recur values so we can process the additional gift as a
+ // one-off payment.
+ if ($form->_membershipBlock['is_separate_payment']) {
+ $cachedFormValue = CRM_Utils_Array::value('is_recur', $form->_values);
+ unset($form->_values['is_recur']);
+ $cachedParamValue = CRM_Utils_Array::value('is_recur', $paymentParams);
+ unset($paymentParams['is_recur']);
+ }
+