From 427ae6c5d34ce58fac4791674e5083b1eefa9ab0 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Fri, 17 Nov 2017 18:26:28 +0530 Subject: [PATCH] fix contribution page loading on no processor --- CRM/Contribute/Form/ContributionBase.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 01e5e0d155..216c8149e2 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -328,13 +328,11 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { } } - if ($isMonetary && - ($isPayLater || !empty($this->_values['payment_processor'])) - ) { - $this->_paymentProcessorIDs = explode( + if ($isMonetary) { + $this->_paymentProcessorIDs = array_filter(explode( CRM_Core_DAO::VALUE_SEPARATOR, CRM_Utils_Array::value('payment_processor', $this->_values) - ); + )); $this->assignPaymentProcessor($isPayLater); } @@ -567,20 +565,20 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { } //fix for CRM-3767 - $assignCCInfo = FALSE; + $isMonetary = FALSE; if ($this->_amount > 0.0) { - $assignCCInfo = TRUE; + $isMonetary = TRUE; } elseif (!empty($this->_params['selectMembership'])) { $memFee = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $this->_params['selectMembership'], 'minimum_fee'); if ($memFee > 0.0) { - $assignCCInfo = TRUE; + $isMonetary = TRUE; } } // The concept of contributeMode is deprecated. // The payment processor object can provide info about the fields it shows. - if ($assignCCInfo && $this->_paymentProcessor) { + if ($isMonetary) { /** @var $paymentProcessorObject \CRM_Core_Payment */ $paymentProcessorObject = $this->_paymentProcessor['object']; $paymentFields = $paymentProcessorObject->getPaymentFormFields(); -- 2.25.1