Skip to content

Commit

Permalink
Merge pull request #19641 from eileenmcnaughton/no_part
Browse files Browse the repository at this point in the history
[REF] Load participant id within completeOrder rather than passing it in
  • Loading branch information
mattwire authored Feb 26, 2021
2 parents 3a23df8 + 1759de8 commit e291659
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4198,7 +4198,6 @@ public static function completeOrder($input, $ids, $contributionID, $isPostPayme
// @todo see if we even need this - it's used further down to create an activity
// but the BAO layer should create that - we just need to add a test to cover it & can
// maybe remove $ids altogether.
$participantID = $ids['participant'];
$recurringContributionID = $ids['contributionRecur'];

// Unset ids just to make it clear it's not used again.
Expand Down Expand Up @@ -4253,8 +4252,9 @@ public static function completeOrder($input, $ids, $contributionID, $isPostPayme
}
}
else {
if (empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
$participantParams['id'] = $participantID;
$participantPayment = civicrm_api3('ParticipantPayment', 'get', ['contribution_id' => $contributionID, 'return' => 'participant_id', 'sequential' => 1])['values'];
if (!empty($participantPayment) && empty($input['IAmAHorribleNastyBeyondExcusableHackInTheCRMEventFORMTaskClassThatNeedsToBERemoved'])) {
$participantParams['id'] = $participantPayment[0]['participant_id'];
$participantParams['status_id'] = 'Registered';
civicrm_api3('Participant', 'create', $participantParams);
}
Expand Down

0 comments on commit e291659

Please sign in to comment.