additional fix to load selected payment instrument field on edit
authordeb.monish <monish.deb@jmaconsulting.biz>
Thu, 31 Aug 2017 19:31:31 +0000 (01:01 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Wed, 13 Sep 2017 08:36:12 +0000 (14:06 +0530)
CRM/Contribute/Form/AbstractEditPayment.php
CRM/Contribute/Form/Contribution.php

index 974747c88c992b5f5282ea8d368837d3b2a76626..1a9573dd732657e085f4a239517f461b1735522f 100644 (file)
@@ -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());
index 85f0630e08cb77836fc552133294ef85e9d51999..5b4c153daac7afac434892879377d863e5aa6caa 100644 (file)
@@ -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) {