From 1775d73b38a3d0a4b9d251d241d1691dad9ee4b2 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 21 Dec 2021 18:06:41 +1300 Subject: [PATCH] [REF] Stop passing this as form, set in function --- CRM/Contribute/Form/Contribution/Confirm.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 5c370325aa77..f57911b43075 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1452,8 +1452,7 @@ protected function processMembership($membershipParams, $contactID, $customField $membershipParams['contribution_source'] = $this->_params['membership_source']; } - $this->postProcessMembership($membershipParams, $contactID, - $this, $premiumParams, $customFieldsFormatted, $fieldTypes, $membershipType, $membershipTypeIDs, $isPaidMembership, $this->_membershipId, $isProcessSeparateMembershipTransaction, $financialTypeID, + $this->postProcessMembership($membershipParams, $contactID, $premiumParams, $customFieldsFormatted, $fieldTypes, $membershipType, $membershipTypeIDs, $isPaidMembership, $this->_membershipId, $isProcessSeparateMembershipTransaction, $financialTypeID, $membershipLineItems); $this->assign('membership_assign', TRUE); @@ -1467,8 +1466,6 @@ protected function processMembership($membershipParams, $contactID, $customField * Array of membership fields. * @param int $contactID * Contact id. - * @param CRM_Contribute_Form_Contribution_Confirm $form - * Confirmation form object. * * @param array $premiumParams * @param null $customFieldsFormatted @@ -1492,10 +1489,11 @@ protected function processMembership($membershipParams, $contactID, $customField * @throws \Civi\Payment\Exception\PaymentProcessorException */ protected function postProcessMembership( - $membershipParams, $contactID, &$form, $premiumParams, + $membershipParams, $contactID, $premiumParams, $customFieldsFormatted, $includeFieldTypes, $membershipDetails, $membershipTypeIDs, $isPaidMembership, $membershipID, $isProcessSeparateMembershipTransaction, $financialTypeID, $unprocessedLineItems) { - + // Assign $this to $form while we eliminate it. + $form = $this; $membershipContribution = NULL; $isTest = $membershipParams['is_test'] ?? FALSE; $errors = $paymentResults = []; @@ -1524,7 +1522,7 @@ protected function postProcessMembership( CRM_Price_BAO_LineItem::getLineItemArray($membershipParams); } - $paymentResult = $form->processConfirm( + $paymentResult = $this->processConfirm( $membershipParams, $contactID, $financialTypeID,