From: Donald A. Lobo Date: Thu, 9 May 2013 20:15:51 +0000 (-0700) Subject: CRM-12559 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9879aeb8c383568afbb305f83a69fa0a4e0dcb7e;p=civicrm-core.git CRM-12559 ---------------------------------------- * CRM-12559: Handle failed contributions in CRM_Contribute_BAO_Contribution_Confirm::processContribution() http://issues.civicrm.org/jira/browse/CRM-12559 --- 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();