From 682c12c0cf203701cfdd2d4d831c734fb258b2b8 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Tue, 28 Nov 2017 08:35:44 +0530 Subject: [PATCH] CRM-21436: Fix exception on pay later contribution page. (#11317) * CRM-21436: Fix exception on pay later contribution page. * minor fix * move test against master * variable fix --- CRM/Core/Form.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 6d772bb78c..948d7ce4e3 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -724,20 +724,20 @@ class CRM_Core_Form extends HTML_QuickForm_Page { * * It would be good to sync it with the back-end function on abstractEditPayment & use one everywhere. * - * @param bool $is_pay_later_enabled + * @param bool $isPayLaterEnabled * * @throws \CRM_Core_Exception */ - protected function assignPaymentProcessor($is_pay_later_enabled) { + protected function assignPaymentProcessor($isPayLaterEnabled) { $this->_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors( array(ucfirst($this->_mode) . 'Mode'), $this->_paymentProcessorIDs ); + if ($isPayLaterEnabled) { + $this->_paymentProcessors[0] = CRM_Financial_BAO_PaymentProcessor::getPayment(0); + } if (!empty($this->_paymentProcessors)) { - if ($is_pay_later_enabled) { - $this->_paymentProcessors[0] = CRM_Financial_BAO_PaymentProcessor::getPayment(0); - } foreach ($this->_paymentProcessors as $paymentProcessorID => $paymentProcessorDetail) { if (empty($this->_paymentProcessor) && $paymentProcessorDetail['is_default'] == 1 || (count($this->_paymentProcessors) == 1) ) { -- 2.25.1