From 11af3021f811ee058da6a17d8842e1dd570ac852 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 19 Aug 2020 23:33:37 +0100 Subject: [PATCH] Remove first_contribution key from repeattransaction --- CRM/Contribute/BAO/Contribution.php | 1 - CRM/Core/Payment/BaseIPN.php | 6 ------ api/v3/Contribution.php | 4 ---- 3 files changed, 11 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e5d83dd6cf..496d64dcda 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4455,7 +4455,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac public static function completeOrder($input, &$ids, $objects, $isPostPaymentCreate = FALSE) { $transaction = new CRM_Core_Transaction(); $contribution = $objects['contribution']; - $primaryContributionID = $contribution->id ?? $objects['first_contribution']->id; // The previous details are used when calculating line items so keep it before any code that 'does something' if (!empty($contribution->id)) { $input['prevContribution'] = CRM_Contribute_BAO_Contribution::getValues(['id' => $contribution->id]); diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 27b0074814..930baec016 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -135,12 +135,6 @@ class CRM_Core_Payment_BaseIPN { if (!$this->loadObjects($input, $ids, $objects, $required, $paymentProcessorID)) { return FALSE; } - //the process is that the loadObjects is kind of hacked by loading the objects for the original contribution and then somewhat inconsistently using them for the - //current contribution. Here we ensure that the original contribution is available to the complete transaction function - //we don't want to fix this in the payment processor classes because we would have to fix all of them - so better to fix somewhere central - if (isset($objects['contributionRecur'])) { - $objects['first_contribution'] = $objects['contribution']; - } return TRUE; } diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 298980b4a7..a1b06305e9 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -654,10 +654,6 @@ function civicrm_api3_contribution_repeattransaction($params) { function _ipn_process_transaction(&$params, $contribution, $input, $ids, $firstContribution = NULL) { $objects = $contribution->_relatedObjects; $objects['contribution'] = &$contribution; - - if ($firstContribution) { - $objects['first_contribution'] = $firstContribution; - } $input['component'] = $contribution->_component; $input['is_test'] = $contribution->is_test; $input['amount'] = empty($input['total_amount']) ? $contribution->total_amount : $input['total_amount']; -- 2.25.1