From 251a4af9d87009600d1d83a8e53eb2adf8003096 Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Wed, 13 Nov 2019 18:57:07 +1300 Subject: [PATCH] Remove unused variables in completeOrder() --- CRM/Contribute/BAO/Contribution.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 90d9a5415b..f75880fcaf 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4597,13 +4597,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $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); -- 2.25.1