Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Remove always FALSE variable from transitionComponents #18983

Merged
merged 1 commit into from
Nov 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,6 @@ public static function checkOnlinePendingContribution($componentId, $componentNa
* 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
Expand All @@ -2134,7 +2133,7 @@ public static function checkOnlinePendingContribution($componentId, $componentNa
* 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;
Expand Down Expand Up @@ -2232,10 +2231,10 @@ public static function transitionComponents($params, $processContributionObject
$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)) {

Expand Down Expand Up @@ -2402,10 +2401,6 @@ public static function transitionComponents($params, $processContributionObject
);
}

if ($processContributionObject) {
$processContribution = TRUE;
}

CRM_Utils_Hook::post('edit', 'Membership', $membership->id, $membership);
}
}
Expand All @@ -2414,18 +2409,10 @@ public static function transitionComponents($params, $processContributionObject
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;
}
}
}

Expand Down