From 9a7ba24db52848984b7119e73eaccd9cde343f77 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 18 Dec 2017 21:13:34 +1300 Subject: [PATCH] CRM-21445 ensure pay_later processor is set so we do not get a fatal on zero amount --- CRM/Contribute/Form/Contribution/Confirm.php | 2 +- CRM/Contribute/Form/ContributionBase.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 14355de49d..3a7028a46f 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -292,7 +292,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // lineItem isn't set until Register postProcess $this->_lineItem = $this->get('lineItem'); $this->_ccid = $this->get('ccid'); - $this->_paymentProcessor = $this->get('paymentProcessor'); + $this->_params = $this->controller->exportValues('Main'); $this->_params['ip_address'] = CRM_Utils_System::ipAddress(); $this->_params['amount'] = $this->get('amount'); diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 216c8149e2..933128ea32 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -294,6 +294,9 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->_fields = $this->get('fields'); $this->_bltID = $this->get('bltID'); $this->_paymentProcessor = $this->get('paymentProcessor'); + if (!$this->_paymentProcessor) { + $this->_paymentProcessor = array('object' => Civi\Payment\System::singleton()->getById(0)); + } $this->_priceSetId = $this->get('priceSetId'); $this->_priceSet = $this->get('priceSet'); -- 2.25.1