From: Eileen McNaughton Date: Fri, 16 Sep 2022 05:37:06 +0000 (+1200) Subject: Remove usage of result from deprecated contributionStatus X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3a2a5750c9cc36a22f3016c1387e8d2958845ec2;p=civicrm-core.git Remove usage of result from deprecated contributionStatus --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index fbf79c1b7d..d3f3cb5d32 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3182,10 +3182,9 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $params['trxnParams']['trxn_id'] = $params['prevContribution']->trxn_id; } $params['trxnParams']['status_id'] = $params['prevContribution']->contribution_status_id; - - if (!(($params['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses) - || $params['prevContribution']->contribution_status_id == array_search('In Progress', $contributionStatuses)) - && $params['contribution']->contribution_status_id == array_search('Completed', $contributionStatuses)) + $previousContributionStatus = CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $params['prevContribution']->contribution_status_id); + if (!(($previousContributionStatus === 'Pending' || $previousContributionStatus === 'In Progress') + && $contributionStatus === 'Completed') ) { $params['trxnParams']['payment_instrument_id'] = $params['prevContribution']->payment_instrument_id; $params['trxnParams']['check_number'] = $params['prevContribution']->check_number;