From 9879aeb8c383568afbb305f83a69fa0a4e0dcb7e Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Thu, 9 May 2013 13:15:51 -0700 Subject: [PATCH] CRM-12559 ---------------------------------------- * CRM-12559: Handle failed contributions in CRM_Contribute_BAO_Contribution_Confirm::processContribution() http://issues.civicrm.org/jira/browse/CRM-12559 --- CRM/Contribute/Form/Contribution/Confirm.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 6e3af38f57..6ba8345fb4 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1303,6 +1303,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $contribParams['line_item'] = $form->_lineItem; //add contribution record $contribution = CRM_Contribute_BAO_Contribution::add($contribParams, $ids); + if (is_a($contribution, 'CRM_Core_Error')) { + $message = CRM_Core_Error::getMessages($contribution); + CRM_Core_Error::fatal($message); + } } // process soft credit / pcp pages @@ -1447,7 +1451,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // create an activity record if ($contribution) { - CRM_Activity_BAO_Activity::addActivity($contribution, NULL, $targetContactID); + CRM_Activity_BAO_Activity::addActivity($contribution, NULL, $targetContactID); } $transaction->commit(); -- 2.25.1