From c497035a3eb6c48776da78cdcecefd1e2f2a2cfe Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 16 Dec 2020 14:03:12 +1300 Subject: [PATCH] Remove or hard-code variables from previously shared function This function was separated from the shared function for cleanup. This removes 3 variables - isRecur (always true) - billingId - this is elsewhere handled on the form - online (always false) For billing id this is handled through back office form shared functions. The handling might be slightly different but it seems more important that the form is internally consistent with how it creates billing addresses (between recur & non-recur) than with other forms --- CRM/Member/Form/Membership.php | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 5c1e1e6a1d..ca0fe1d208 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -1323,9 +1323,7 @@ DESC limit 1"); 'thankyou_date' => $paymentParams['thankyou_date'] ?? NULL, 'payment_instrument_id' => $paymentInstrumentID, ], - $financialType, - FALSE, - $this->_bltID + $financialType ); //create new soft-credit record, CRM-13981 @@ -1871,11 +1869,6 @@ DESC limit 1"); * - thankyou_date (not all forms will set this) * * @param CRM_Financial_DAO_FinancialType $financialType - * @param bool $online - * Is the form a front end form? If so set a bunch of unpredictable things that should be passed in from the form. - * - * @param int $billingLocationID - * ID of billing location type. * * @return \CRM_Contribute_DAO_Contribution * @@ -1887,9 +1880,7 @@ DESC limit 1"); $params, $result, $contributionParams, - $financialType, - $online, - $billingLocationID + $financialType ) { $transaction = new CRM_Core_Transaction(); $contactID = $contributionParams['contact_id']; @@ -1899,8 +1890,6 @@ DESC limit 1"); // add these values for the recurringContrib function ,CRM-10188 $params['financial_type_id'] = $financialType->id; - $contributionParams['address_id'] = CRM_Contribute_BAO_Contribution::createAddress($params, $billingLocationID); - //@todo - this is being set from the form to resolve CRM-10188 - an // eNotice caused by it not being set @ the front end // however, we then get it being over-written with null for backend contributions @@ -1926,7 +1915,7 @@ DESC limit 1"); $result, $receiptDate, $recurringContributionID), $contributionParams ); - $contributionParams['non_deductible_amount'] = CRM_Contribute_Form_Contribution_Confirm::getNonDeductibleAmount($params, $financialType, $online, $form); + $contributionParams['non_deductible_amount'] = CRM_Contribute_Form_Contribution_Confirm::getNonDeductibleAmount($params, $financialType, FALSE, $form); $contributionParams['skipCleanMoney'] = TRUE; // @todo this is the wrong place for this - it should be done as close to form submission // as possible @@ -1967,14 +1956,7 @@ DESC limit 1"); //CRM-13981, processing honor contact into soft-credit contribution CRM_Contribute_BAO_ContributionSoft::processSoftContribution($params, $contribution); - if ($online && $contribution) { - CRM_Core_BAO_CustomValueTable::postProcess($params, - 'civicrm_contribution', - $contribution->id, - 'Contribution' - ); - } - elseif ($contribution) { + if ($contribution) { //handle custom data. $params['contribution_id'] = $contribution->id; if (!empty($params['custom']) && -- 2.25.1