CRM-21445 ensure pay_later processor is set so we do not get a fatal on zero amount
authoreileen <emcnaughton@wikimedia.org>
Mon, 18 Dec 2017 08:13:34 +0000 (21:13 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 19 Dec 2017 03:01:24 +0000 (16:01 +1300)
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/ContributionBase.php

index 14355de49d95c4d803d49f3f05b30070ba80bea5..3a7028a46fc5c326fd7d87325fdf341deed07c18 100644 (file)
@@ -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');
index 216c8149e25292794bb5b1ec5d836c92669a4506..933128ea3208145f49faa664a99b55728f0c6d8b 100644 (file)
@@ -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');