From a576ecfa5dca1aec2bc35a741285dd486a443b08 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Fri, 1 Sep 2017 01:01:31 +0530 Subject: [PATCH] additional fix to load selected payment instrument field on edit --- CRM/Contribute/Form/AbstractEditPayment.php | 2 +- CRM/Contribute/Form/Contribution.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 974747c88c..1a9573dd73 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -516,7 +516,7 @@ WHERE contribution_id = {$id} } $this->assignProcessors(); $this->assignBillingType(); - CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor, FALSE, TRUE, CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer')); + CRM_Core_Payment_Form::setPaymentFieldsByProcessor($this, $this->_paymentProcessor, FALSE, TRUE, CRM_Utils_Request::retrieve('payment_instrument_id', 'Integer', $this)); } catch (CRM_Core_Exception $e) { CRM_Core_Error::statusBounce($e->getMessage()); diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 85f0630e08..5b4c153daa 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -550,7 +550,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $paneNames[ts('Premium Information')] = 'Premium'; } - if (CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->getDefaultPaymentInstrumentId()) == TRUE) { + $this->payment_instrument_id = CRM_Utils_Array::value('payment_instrument_id', $defaults, $this->getDefaultPaymentInstrumentId()); + if (CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->payment_instrument_id) == TRUE) { if (!empty($this->_recurPaymentProcessors)) { $buildRecurBlock = TRUE; if ($this->_ppID) { -- 2.25.1