From 27fdea23dbc7cf51cab8c8287d4f9551be2c3aab Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 11 Sep 2017 17:33:37 +1200 Subject: [PATCH] CRM-20750 follow up. Change logic for determinig paymentInstrumentChange to look at whether ['payment_instrument_id'] isset. If not it has not been passed by the calling function and by definition the calling function is not attempting to change it --- CRM/Contribute/BAO/Contribution.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 15c792e8aa..d71f0fc5ef 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -5351,7 +5351,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co if (array_key_exists('payment_instrument_id', $params)) { if (CRM_Utils_System::isNull($params['prevContribution']->payment_instrument_id) && - !CRM_Utils_System::isNull($params['contribution']->payment_instrument_id) + !CRM_Utils_System::isNull($params['payment_instrument_id']) ) { //check if status is changed from Pending to Completed // do not update payment instrument changes for Pending to Completed @@ -5361,7 +5361,7 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co return TRUE; } } - elseif ((!CRM_Utils_System::isNull($params['contribution']->payment_instrument_id) || + elseif ((!CRM_Utils_System::isNull($params['payment_instrument_id']) && !CRM_Utils_System::isNull($params['prevContribution']->payment_instrument_id)) && $params['contribution']->payment_instrument_id != $params['prevContribution']->payment_instrument_id ) { -- 2.25.1