Skip to content

Commit

Permalink
Merge pull request civicrm#19227 from eileenmcnaughton/mem_form
Browse files Browse the repository at this point in the history
Remove or hard-code variables from previously shared function
  • Loading branch information
seamuslee001 authored Dec 22, 2020
2 parents bd21c9a + c497035 commit f0eff43
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions CRM/Member/Form/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -1308,10 +1308,7 @@ public function submit() {
'thankyou_date' => $paymentParams['thankyou_date'] ?? NULL,
'payment_instrument_id' => $paymentInstrumentID,
],
$financialType,
FALSE,
$this->_bltID,
TRUE
$financialType
);

//create new soft-credit record, CRM-13981
Expand Down Expand Up @@ -1859,13 +1856,6 @@ protected function getSelectedMembershipLabels(): string {
* - 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.
* @param bool $isRecur
* Is this recurring?
*
* @return \CRM_Contribute_DAO_Contribution
*
Expand All @@ -1877,10 +1867,7 @@ public static function processFormContribution(
$params,
$result,
$contributionParams,
$financialType,
$online,
$billingLocationID,
$isRecur
$financialType
) {
$transaction = new CRM_Core_Transaction();
$contactID = $contributionParams['contact_id'];
Expand All @@ -1890,8 +1877,6 @@ public static function processFormContribution(
// 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
Expand All @@ -1901,7 +1886,7 @@ public static function processFormContribution(
if (!isset($params['is_email_receipt']) && $isEmailReceipt) {
$params['is_email_receipt'] = $isEmailReceipt;
}
$params['is_recur'] = $isRecur;
$params['is_recur'] = TRUE;
$params['payment_instrument_id'] = $contributionParams['payment_instrument_id'] ?? NULL;
$recurringContributionID = CRM_Contribute_Form_Contribution_Confirm::processRecurringContribution($form, $params, $contactID, $financialType);

Expand All @@ -1917,7 +1902,7 @@ public static function processFormContribution(
$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
Expand All @@ -1935,14 +1920,7 @@ public static function processFormContribution(
//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']) &&
Expand Down

0 comments on commit f0eff43

Please sign in to comment.