From c4ff02d2051845fc33e8076f57870011c5d921f9 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 17 Nov 2020 14:38:12 +1300 Subject: [PATCH] [REF] Remove always FALSE variable from transitionComponents This is not ever passed in now we have removed the call from membership form I've kept this PR restricted to changes in transitionComponents since that means the main reviewer task is to confirm the paramter is never passed in & hence is false, but quite a lot of other stuff can be ripped out as follow ups --- CRM/Contribute/BAO/Contribution.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 4453f2a674..2daba091c7 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2124,7 +2124,6 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * This function by-passes hooks - to address this - don't use this function. * * @param array $params - * @param bool $processContributionObject * * @throws CRM_Core_Exception * @throws \CiviCRM_API3_Exception @@ -2134,7 +2133,7 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ * For failures use failPayment (preferably exposing by api in the process). * */ - public static function transitionComponents($params, $processContributionObject = FALSE) { + public static function transitionComponents($params) { // get minimum required values. $contactId = $params['contact_id'] ?? NULL; $componentId = $params['component_id'] ?? NULL; @@ -2232,10 +2231,10 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ $processContribution = FALSE; if ($contributionStatusId == array_search('Cancelled', $contributionStatuses)) { // Call interim cancel function - with a goal to cleaning up the signature on it and switching to a tested api Contribution.cancel function. - list($updateResult, $processContribution) = self::cancel($processContributionObject, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $oldStatus, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); + list($updateResult, $processContribution) = self::cancel(FALSE, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $oldStatus, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); } elseif ($contributionStatusId == array_search('Failed', $contributionStatuses)) { - list($updateResult, $processContribution) = self::processFail($processContributionObject, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); + list($updateResult, $processContribution) = self::processFail(FALSE, $memberships, $contributionId, $membershipStatuses, $updateResult, $participant, $pledgePayment, $pledgeID, $pledgePaymentIDs, $contributionStatusId); } elseif ($contributionStatusId == array_search('Completed', $contributionStatuses)) { @@ -2402,10 +2401,6 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ ); } - if ($processContributionObject) { - $processContribution = TRUE; - } - CRM_Utils_Hook::post('edit', 'Membership', $membership->id, $membership); } } @@ -2414,18 +2409,10 @@ LEFT JOIN civicrm_contribution contribution ON ( componentPayment.contribution_ if ($participant) { $updatedStatusId = array_search('Registered', $participantStatuses); CRM_Event_BAO_Participant::updateParticipantStatus($participant->id, $oldStatus, $updatedStatusId, TRUE); - - if ($processContributionObject) { - $processContribution = TRUE; - } } if ($pledgePayment) { CRM_Pledge_BAO_PledgePayment::updatePledgePaymentStatus($pledgeID, $pledgePaymentIDs, $contributionStatusId); - - if ($processContributionObject) { - $processContribution = TRUE; - } } } -- 2.25.1