// @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.
}
}
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);
}