Skip to content

Commit

Permalink
Merge pull request civicrm#15841 from mattwire/participant_cleanup_re…
Browse files Browse the repository at this point in the history
…moveparticipantfrominput

Remove unused variables in completeOrder()
  • Loading branch information
eileenmcnaughton authored Nov 21, 2019
2 parents 2972cd1 + 251a4af commit eda4c59
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -4580,13 +4580,9 @@ public static function completeOrder($input, &$ids, $objects, $transaction, $con
$input['payment_processor'] = $paymentProcessorId;
}

if (!empty($contribution->_relatedObjects['participant'])) {
$input['contribution_mode'] = 'participant';
$input['participant_id'] = $contribution->_relatedObjects['participant']->id;
}
elseif (!empty($contribution->_relatedObjects['membership'])) {
if (empty($contribution->_relatedObjects['participant']) && !empty($contribution->_relatedObjects['membership'])) {
// @fixme Can we remove this if altogether? - we removed the participant if / else and left relatedObjects['participant'] to ensure behaviour didn't change but it is probably not required.
// @todo - use getRelatedMemberships instead
$input['contribution_mode'] = 'membership';
$contribution->contribution_status_id = $contributionParams['contribution_status_id'];
$contribution->trxn_id = CRM_Utils_Array::value('trxn_id', $input);
$contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
Expand Down

0 comments on commit eda4c59

Please sign in to comment.