Skip to content

Commit

Permalink
CRM-21445 ensure pay_later processor is set so we do not get a fatal …
Browse files Browse the repository at this point in the history
…on zero amount
  • Loading branch information
eileenmcnaughton committed Dec 19, 2017
1 parent 6a0b4a5 commit 9a7ba24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contribute/Form/Contribution/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function preProcess() {
// 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');
Expand Down
3 changes: 3 additions & 0 deletions CRM/Contribute/Form/ContributionBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ public function preProcess() {
$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');

Expand Down

0 comments on commit 9a7ba24

Please sign in to comment.