diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php
index 1efa8202448f..68282aee31c1 100644
--- a/CRM/Activity/BAO/Activity.php
+++ b/CRM/Activity/BAO/Activity.php
@@ -1770,8 +1770,7 @@ public static function addActivity(
// @todo - use api - remove lots of wrangling above. Remove deprecated fatal & let form layer
// deal with any exceptions.
if (is_a(self::create($activityParams), 'CRM_Core_Error')) {
- CRM_Core_Error::fatal("Failed creating Activity for $component of id {$activity->id}");
- return FALSE;
+ throw new CRM_Core_Exception("Failed creating Activity for $component of id {$activity->id}");
}
}
diff --git a/CRM/Activity/Import/Parser.php b/CRM/Activity/Import/Parser.php
index b3b5871aff14..d74f955ca08d 100644
--- a/CRM/Activity/Import/Parser.php
+++ b/CRM/Activity/Import/Parser.php
@@ -67,7 +67,7 @@ public function run(
$totalRowCount = NULL
) {
if (!is_array($fileName)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to determine import file');
}
$fileName = $fileName['name'];
diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php
index 694f6a84d420..6e74c02f18de 100644
--- a/CRM/Contact/BAO/Query.php
+++ b/CRM/Contact/BAO/Query.php
@@ -2323,7 +2323,7 @@ public function restWhere(&$values) {
}
// we don't know when this might happen
else {
- CRM_Core_Error::fatal(ts("%1 is not a valid operator", [1 => $operator]));
+ throw new CRM_Core_Exception(ts("%1 is not a valid operator", [1 => $operator]));
}
}
}
@@ -2417,7 +2417,7 @@ public static function getLocationTableName(&$where, &$locType) {
$tName = str_replace(' ', '_', $tName);
return [$tName, $fldName];
}
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Cannot determine location table information');
}
/**
@@ -2973,7 +2973,7 @@ public function group($values) {
if (is_array($value) && count($value) > 1) {
if (strpos($op, 'IN') === FALSE && strpos($op, 'NULL') === FALSE) {
- CRM_Core_Error::fatal(ts("%1 is not a valid operator", [1 => $op]));
+ throw new CRM_Core_Exception(ts("%1 is not a valid operator", [1 => $op]));
}
$this->_useDistinct = TRUE;
}
diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index 6ad09931c8fe..10501932192f 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@@ -2115,7 +2115,7 @@ public static function transitionComponents($params, $processContributionObject
$ids['contributionPage'] = NULL;
if (!$baseIPN->validateData($input, $ids, $objects, FALSE)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to validate supplied data');
}
$memberships = &$objects['membership'];
diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php
index 0550fb39f372..5f4baed935cd 100644
--- a/CRM/Core/Controller.php
+++ b/CRM/Core/Controller.php
@@ -814,7 +814,7 @@ public function invalidKey() {
public function invalidKeyCommon() {
$msg = ts("We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.") . '
' . ts('Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.') . '
' . ts('Error type: Could not find a valid session key.');
- CRM_Core_Error::fatal($msg);
+ throw new CRM_Core_Exception($msg);
}
/**
diff --git a/CRM/Core/IDS.php b/CRM/Core/IDS.php
index 7a3eded15af8..5401ea811701 100644
--- a/CRM/Core/IDS.php
+++ b/CRM/Core/IDS.php
@@ -292,7 +292,7 @@ private function kick() {
);
CRM_Utils_JSON::output($error);
}
- CRM_Core_Error::fatal($msg);
+ throw new CRM_Core_Exception($msg);
}
}
diff --git a/CRM/Core/JobManager.php b/CRM/Core/JobManager.php
index ed2954fc1d14..d19e786d4ad1 100644
--- a/CRM/Core/JobManager.php
+++ b/CRM/Core/JobManager.php
@@ -181,7 +181,7 @@ private function _getJobs() {
*/
private function _getJob($id = NULL, $entity = NULL, $action = NULL) {
if (is_null($id) && is_null($action)) {
- CRM_Core_Error::fatal('You need to provide either id or name to use this method');
+ throw new CRM_Core_Exception('You need to provide either id or name to use this method');
}
$dao = new CRM_Core_DAO_Job();
$dao->id = $id;
diff --git a/CRM/Core/Page/AJAX.php b/CRM/Core/Page/AJAX.php
index 32dcbffba90a..ccbcd67251f9 100644
--- a/CRM/Core/Page/AJAX.php
+++ b/CRM/Core/Page/AJAX.php
@@ -34,7 +34,7 @@ public static function run() {
}
if (!$className) {
- CRM_Core_Error::fatal(ts('Invalid className: %1', [1 => $className]));
+ throw new CRM_Core_Exception(ts('Invalid className: %1', [1 => $className]));
}
$fnName = NULL;
diff --git a/CRM/Core/Page/Redirect.php b/CRM/Core/Page/Redirect.php
index 15141ae4f021..ed855d1df010 100644
--- a/CRM/Core/Page/Redirect.php
+++ b/CRM/Core/Page/Redirect.php
@@ -38,7 +38,7 @@ public function run($path = NULL, $pageArgs = []) {
*/
public static function createUrl($requestPath, $requestArgs, $pageArgs, $absolute) {
if (empty($pageArgs['url'])) {
- CRM_Core_Error::fatal('This page is configured as a redirect, but it does not have a target.');
+ CRM_Core_Error::statusBounce('This page is configured as a redirect, but it does not have a target.');
}
$vars = [];
diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php
index 08c978af389b..2c71a406defa 100644
--- a/CRM/Core/Permission.php
+++ b/CRM/Core/Permission.php
@@ -508,7 +508,7 @@ public static function checkMenu(&$args, $op = 'and') {
public static function checkMenuItem(&$item) {
if (!array_key_exists('access_callback', $item)) {
CRM_Core_Error::backtrace();
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Missing Access Callback key in menu item');
}
// if component_id is present, ensure it is enabled
diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php
index 5d101d1d70ff..242387ca65af 100644
--- a/CRM/Core/Region.php
+++ b/CRM/Core/Region.php
@@ -223,8 +223,8 @@ public function render($default, $allowCmsOverride = TRUE) {
break;
default:
- require_once 'CRM/Core/Error.php';
- CRM_Core_Error::fatal(ts('Snippet type %1 is unrecognized',
+ require_once 'CRM/Core/Exception.php';
+ throw new CRM_Core_Exception(ts('Snippet type %1 is unrecognized',
[1 => $snippet['type']]));
}
}
diff --git a/CRM/Core/Selector/Base.php b/CRM/Core/Selector/Base.php
index e80d6fcd3eb8..268f0e584206 100644
--- a/CRM/Core/Selector/Base.php
+++ b/CRM/Core/Selector/Base.php
@@ -123,9 +123,6 @@ public function &getSortOrder($action) {
unset($header);
}
}
- if ($firstElementNotFound) {
- // CRM_Core_Error::fatal( "Could not find a valid sort directional element" );
- }
}
return $this->_order;
}
diff --git a/CRM/Custom/Form/ChangeFieldType.php b/CRM/Custom/Form/ChangeFieldType.php
index c26c5c04f553..90d87917edaa 100644
--- a/CRM/Custom/Form/ChangeFieldType.php
+++ b/CRM/Custom/Form/ChangeFieldType.php
@@ -61,7 +61,7 @@ public function preProcess() {
);
if (empty($this->_values) || empty($this->_htmlTypeTransitions)) {
- CRM_Core_Error::fatal(ts("Invalid custom field or can't change input type of this custom field."));
+ CRM_Core_Error::statusBounce(ts("Invalid custom field or can't change input type of this custom field."));
}
$url = CRM_Utils_System::url('civicrm/admin/custom/group/field/update',
diff --git a/CRM/Custom/Form/Field.php b/CRM/Custom/Form/Field.php
index e61d23ed803c..b7597bfe5f12 100644
--- a/CRM/Custom/Form/Field.php
+++ b/CRM/Custom/Form/Field.php
@@ -121,7 +121,7 @@ public function preProcess() {
}
if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
- CRM_Core_Error::fatal("You cannot add or edit fields in a reserved custom field-set.");
+ CRM_Core_Error::statusBounce("You cannot add or edit fields in a reserved custom field-set.");
}
if ($this->_gid) {
diff --git a/CRM/Custom/Form/Option.php b/CRM/Custom/Form/Option.php
index 14e7b509e16a..5a0c3d5eb384 100644
--- a/CRM/Custom/Form/Option.php
+++ b/CRM/Custom/Form/Option.php
@@ -76,7 +76,7 @@ public function preProcess() {
}
if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
- CRM_Core_Error::fatal("You cannot add or edit muliple choice options in a reserved custom field-set.");
+ CRM_Core_Error::statusBounce("You cannot add or edit muliple choice options in a reserved custom field-set.");
}
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
diff --git a/CRM/Custom/Import/Parser.php b/CRM/Custom/Import/Parser.php
index 09b3258a5eba..c71018bb7956 100644
--- a/CRM/Custom/Import/Parser.php
+++ b/CRM/Custom/Import/Parser.php
@@ -68,7 +68,7 @@ public function run(
$onDuplicate = self::DUPLICATE_SKIP
) {
if (!is_array($fileName)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to determine import file');
}
$fileName = $fileName['name'];
diff --git a/CRM/Custom/Page/Field.php b/CRM/Custom/Page/Field.php
index 708b342a24e5..d10a73dfa375 100644
--- a/CRM/Custom/Page/Field.php
+++ b/CRM/Custom/Page/Field.php
@@ -226,7 +226,7 @@ public function run() {
}
if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
- CRM_Core_Error::fatal("You cannot add or edit fields in a reserved custom field-set.");
+ CRM_Core_Error::statusBounce("You cannot add or edit fields in a reserved custom field-set.");
}
$action = CRM_Utils_Request::retrieve('action', 'String',
diff --git a/CRM/Custom/Page/Option.php b/CRM/Custom/Page/Option.php
index a932fd36a5bf..7c409c7d780a 100644
--- a/CRM/Custom/Page/Option.php
+++ b/CRM/Custom/Page/Option.php
@@ -213,7 +213,7 @@ public function run() {
);
if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
- CRM_Core_Error::fatal("You cannot add or edit multiple choice options in a reserved custom field-set.");
+ CRM_Core_Error::statusBounce("You cannot add or edit multiple choice options in a reserved custom field-set.");
}
$optionGroupId = $this->getOptionGroupId($this->_fid);
diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php
index 64b2f806ce08..d05b01176df3 100644
--- a/CRM/Event/BAO/Participant.php
+++ b/CRM/Event/BAO/Participant.php
@@ -1496,7 +1496,7 @@ public static function sendTransitionParticipantMail(
];
if (is_a(CRM_Activity_BAO_Activity::create($activityParams), 'CRM_Core_Error')) {
- CRM_Core_Error::fatal('Failed creating Activity for expiration mail');
+ throw new CRM_Core_Exception('Failed creating Activity for expiration mail');
}
}
}
diff --git a/CRM/Event/BAO/ParticipantPayment.php b/CRM/Event/BAO/ParticipantPayment.php
index 106b2bbae344..754e146e4a8a 100644
--- a/CRM/Event/BAO/ParticipantPayment.php
+++ b/CRM/Event/BAO/ParticipantPayment.php
@@ -104,7 +104,7 @@ public static function deleteParticipantPayment($params) {
}
if (!$valid) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Cannot delete participant payment');
}
if ($participantPayment->find(TRUE)) {
diff --git a/CRM/Event/Cart/BAO/Cart.php b/CRM/Event/Cart/BAO/Cart.php
index 1acabfe0a3bd..11111711547e 100644
--- a/CRM/Event/Cart/BAO/Cart.php
+++ b/CRM/Event/Cart/BAO/Cart.php
@@ -70,7 +70,7 @@ public static function create($params) {
if (is_a($cart, 'CRM_Core_Error')) {
$transaction->rollback();
- CRM_Core_Error::fatal(ts('There was an error creating an event cart'));
+ throw new CRM_Core_Exception(ts('There was an error creating an event cart'));
}
$transaction->commit();
@@ -324,7 +324,7 @@ public function get_participant_index_from_id($participant_id) {
public static function retrieve(&$params, &$values) {
$cart = self::find_by_params($params);
if ($cart === FALSE) {
- CRM_Core_Error::fatal(ts('Could not find cart matching %1', [1 => var_export($params, TRUE)]));
+ throw new CRM_Core_Exception(ts('Could not find cart matching %1', [1 => var_export($params, TRUE)]));
}
CRM_Core_DAO::storeValues($cart, $values);
return $values;
diff --git a/CRM/Event/Cart/BAO/EventInCart.php b/CRM/Event/Cart/BAO/EventInCart.php
index 7dd79ec72523..abb9bb4ce6ae 100644
--- a/CRM/Event/Cart/BAO/EventInCart.php
+++ b/CRM/Event/Cart/BAO/EventInCart.php
@@ -40,7 +40,7 @@ public static function create(&$params) {
if (is_a($event_in_cart, 'CRM_Core_Error')) {
$transaction->rollback();
- CRM_Core_Error::fatal(ts('There was an error creating an event_in_cart'));
+ throw new CRM_Core_Exception(ts('There was an error creating an event_in_cart'));
}
$transaction->commit();
diff --git a/CRM/Event/Form/ManageEvent/Repeat.php b/CRM/Event/Form/ManageEvent/Repeat.php
index c7fb5591e1a2..3f1183d606b7 100644
--- a/CRM/Event/Form/ManageEvent/Repeat.php
+++ b/CRM/Event/Form/ManageEvent/Repeat.php
@@ -155,7 +155,7 @@ public function postProcess() {
CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
}
else {
- CRM_Core_Error::fatal("Could not find Event ID");
+ CRM_Core_Error::statusBounce("Could not find Event ID");
}
parent::endPostProcess();
}
diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php
index 6b4c83d19951..6c8b5cbbc226 100644
--- a/CRM/Event/Form/ManageEvent/TabHeader.php
+++ b/CRM/Event/Form/ManageEvent/TabHeader.php
@@ -113,7 +113,7 @@ public static function process(&$form) {
];
$dao = CRM_Core_DAO::executeQuery($sql, $params);
if (!$dao->fetch()) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to determine Event information');;
}
if (!$dao->is_location) {
$tabs['location']['valid'] = FALSE;
diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php
index 638f2b8f2dc5..97ecf1f6f8bf 100644
--- a/CRM/Event/Form/Registration.php
+++ b/CRM/Event/Form/Registration.php
@@ -655,7 +655,7 @@ public static function initEventFee(&$form, $eventID, $includeExpiredFields = TR
}
if ($isPaidEvent && empty($form->_values['fee'])) {
if (CRM_Utils_System::getClassName($form) != 'CRM_Event_Form_Participant') {
- CRM_Core_Error::fatal(ts('No Fee Level(s) or Price Set is configured for this event.
Click CiviEvent >> Manage Event >> Configure >> Event Fees to configure the Fee Level(s) or Price Set for this event.', array(1 => CRM_Utils_System::url('civicrm/event/manage/fee', 'reset=1&action=update&id=' . $form->_eventId))));
+ CRM_Core_Error::statusBounce(ts('No Fee Level(s) or Price Set is configured for this event.
Click CiviEvent >> Manage Event >> Configure >> Event Fees to configure the Fee Level(s) or Price Set for this event.', array(1 => CRM_Utils_System::url('civicrm/event/manage/fee', 'reset=1&action=update&id=' . $form->_eventId))));
}
}
}
diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php
index b168d2f9fec6..c1ec6a798963 100644
--- a/CRM/Event/Import/Parser.php
+++ b/CRM/Event/Import/Parser.php
@@ -70,7 +70,7 @@ public function run(
$onDuplicate = self::DUPLICATE_SKIP
) {
if (!is_array($fileName)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to determine import file');
}
$fileName = $fileName['name'];
diff --git a/CRM/Event/Page/ParticipantListing.php b/CRM/Event/Page/ParticipantListing.php
index a9f718ca61df..6c5ddf07c5e2 100644
--- a/CRM/Event/Page/ParticipantListing.php
+++ b/CRM/Event/Page/ParticipantListing.php
@@ -66,7 +66,7 @@ public function run() {
)
);
if ($className == 'CRM_Event_Page_ParticipantListing') {
- CRM_Core_Error::fatal(ts("Participant listing code file cannot be '%1'",
+ CRM_Core_Error::statusBounce(ts("Participant listing code file cannot be '%1'",
array(1 => $className)
));
}
@@ -77,7 +77,7 @@ public function run() {
) . '.php';
$error = include_once $classFile;
if ($error == FALSE) {
- CRM_Core_Error::fatal('Participant listing code file: ' . $classFile . ' does not exist. Please verify your custom particpant listing settings in CiviCRM administrative panel.');
+ CRM_Core_Error::statusBounce('Participant listing code file: ' . $classFile . ' does not exist. Please verify your custom particpant listing settings in CiviCRM administrative panel.');
}
$participantListingClass = new $className();
diff --git a/CRM/Financial/Page/FinancialTypeAccount.php b/CRM/Financial/Page/FinancialTypeAccount.php
index 9a3552cc61d7..cdbd3d5af913 100644
--- a/CRM/Financial/Page/FinancialTypeAccount.php
+++ b/CRM/Financial/Page/FinancialTypeAccount.php
@@ -166,8 +166,7 @@ public function browse() {
$this->assign('financialTypeTitle', $this->_title);
}
else {
- CRM_Core_Error::fatal();
- return NULL;
+ CRM_Core_Error::statusBounce('No Financial Accounts found for the Financial Type');
}
}
diff --git a/CRM/Member/Form/Task/Batch.php b/CRM/Member/Form/Task/Batch.php
index 0d25822fee23..5c9f9760886f 100644
--- a/CRM/Member/Form/Task/Batch.php
+++ b/CRM/Member/Form/Task/Batch.php
@@ -74,7 +74,7 @@ public function buildQuickForm() {
$ufGroupId = $this->get('ufGroupId');
if (!$ufGroupId) {
- CRM_Core_Error::fatal('ufGroupId is missing');
+ CRM_Core_Error::statusBounce('ufGroupId is missing');
}
$this->_title = ts('Update multiple memberships') . ' - ' . CRM_Core_BAO_UFGroup::getTitle($ufGroupId);
CRM_Utils_System::setTitle($this->_title);
diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php
index e009c5136581..7ad2f3f4cf80 100644
--- a/CRM/Member/Import/Parser.php
+++ b/CRM/Member/Import/Parser.php
@@ -71,7 +71,7 @@ public function run(
$totalRowCount = NULL
) {
if (!is_array($fileName)) {
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to determine import file');
}
$fileName = $fileName['name'];
diff --git a/CRM/Member/Page/DashBoard.php b/CRM/Member/Page/DashBoard.php
index 8ba2539c1361..62dcf8faeb3e 100644
--- a/CRM/Member/Page/DashBoard.php
+++ b/CRM/Member/Page/DashBoard.php
@@ -58,7 +58,7 @@ public function preProcess() {
!checkdate(substr($ym, 4, 2), 1, substr($ym, 0, 4)) ||
substr($ym, 0, 1) == 0
) {
- CRM_Core_Error::fatal(ts('Invalid date query "%1" in URL (valid syntax is yyyymm).', array(1 => $ym)));
+ CRM_Core_Error::statusBounce(ts('Invalid date query "%1" in URL (valid syntax is yyyymm).', array(1 => $ym)));
}
$isPreviousMonth = 0;
diff --git a/CRM/PCP/BAO/PCP.php b/CRM/PCP/BAO/PCP.php
index a871f13b50ed..2ea752cdede2 100644
--- a/CRM/PCP/BAO/PCP.php
+++ b/CRM/PCP/BAO/PCP.php
@@ -665,7 +665,7 @@ public static function sendStatusUpdate($pcpId, $newStatus, $isInitial = FALSE,
if (!$domainEmailAddress || $domainEmailAddress == 'info@EXAMPLE.ORG') {
$fixUrl = CRM_Utils_System::url("civicrm/admin/domain", 'action=update&reset=1');
- CRM_Core_Error::fatal(ts('The site administrator needs to enter a valid \'FROM Email Address\' in Administer CiviCRM » Communications » FROM Email Addresses. The email address used may need to be a valid mail account with your email service provider.', [1 => $fixUrl]));
+ throw new CRM_Core_Exception(ts('The site administrator needs to enter a valid \'FROM Email Address\' in Administer CiviCRM » Communications » FROM Email Addresses. The email address used may need to be a valid mail account with your email service provider.', [1 => $fixUrl]));
}
$receiptFrom = '"' . $domainEmailName . '" <' . $domainEmailAddress . '>';
@@ -913,7 +913,7 @@ public static function getSupporterProfileId($component_id, $component = 'contri
$params = [1 => [$component_id, 'Integer'], 2 => [$entity_table, 'String']];
if (!$supporterProfileId = CRM_Core_DAO::singleValueQuery($query, $params)) {
- CRM_Core_Error::fatal(ts('Supporter profile is not set for this Personal Campaign Page or the profile is disabled. Please contact the site administrator if you need assistance.'));
+ throw new CRM_Core_Exception(ts('Supporter profile is not set for this Personal Campaign Page or the profile is disabled. Please contact the site administrator if you need assistance.'));
}
else {
return $supporterProfileId;
diff --git a/CRM/PCP/Form/Campaign.php b/CRM/PCP/Form/Campaign.php
index 59c56d9ca90e..bea78c69e22e 100644
--- a/CRM/PCP/Form/Campaign.php
+++ b/CRM/PCP/Form/Campaign.php
@@ -300,7 +300,7 @@ public function postProcess() {
if (!$domainEmailAddress || $domainEmailAddress == 'info@EXAMPLE.ORG') {
$fixUrl = CRM_Utils_System::url('civicrm/admin/domain', 'action=update&reset=1');
- CRM_Core_Error::fatal(ts('The site administrator needs to enter a valid \'FROM Email Address\' in Administer CiviCRM » Communications » FROM Email Addresses. The email address used may need to be a valid mail account with your email service provider.', [1 => $fixUrl]));
+ CRM_Core_Error::statusBounce(ts('The site administrator needs to enter a valid \'FROM Email Address\' in Administer CiviCRM » Communications » FROM Email Addresses. The email address used may need to be a valid mail account with your email service provider.', [1 => $fixUrl]));
}
//if more than one email present for PCP notification ,
diff --git a/CRM/PCP/Form/PCPAccount.php b/CRM/PCP/Form/PCPAccount.php
index 502543f49688..7c96a629cfa6 100644
--- a/CRM/PCP/Form/PCPAccount.php
+++ b/CRM/PCP/Form/PCPAccount.php
@@ -57,7 +57,7 @@ public function preProcess() {
if (!$this->_pageId) {
if (!$this->_id) {
$msg = ts('We can\'t load the requested web page due to an incomplete link. This can be caused by using your browser\'s Back button or by using an incomplete or invalid link.');
- CRM_Core_Error::fatal($msg);
+ CRM_Core_Error::statusBounce($msg);
}
else {
$this->_pageId = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $this->_id, 'page_id');
@@ -65,7 +65,7 @@ public function preProcess() {
}
if (!$this->_pageId) {
- CRM_Core_Error::fatal(ts('Could not find source page id.'));
+ CRM_Core_Error::statusBounce(ts('Could not find source page id.'));
}
$this->_single = $this->get('single');
diff --git a/CRM/Price/Form/Option.php b/CRM/Price/Form/Option.php
index ff7a8758818b..750bfb7f99cc 100644
--- a/CRM/Price/Form/Option.php
+++ b/CRM/Price/Form/Option.php
@@ -109,7 +109,7 @@ public function buildQuickForm() {
if ($this->_action == CRM_Core_Action::UPDATE) {
$finTypeId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_oid, 'financial_type_id');
if (!CRM_Financial_BAO_FinancialType::checkPermissionToEditFinancialType($finTypeId)) {
- CRM_Core_Error::fatal(ts("You do not have permission to access this page"));
+ CRM_Core_Error::statusBounce(ts("You do not have permission to access this page"));
}
}
if ($this->_action == CRM_Core_Action::DELETE) {
diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php
index 1d03a0a68340..31fe2d96bd9e 100644
--- a/CRM/Profile/Form.php
+++ b/CRM/Profile/Form.php
@@ -306,7 +306,7 @@ public function preProcess() {
if ($this->_multiRecord &&
!in_array($this->_multiRecord, [CRM_Core_Action::UPDATE, CRM_Core_Action::ADD, CRM_Core_Action::DELETE])
) {
- CRM_Core_Error::fatal(ts('Proper action not specified for this custom value record profile'));
+ CRM_Core_Error::statusBounce(ts('Proper action not specified for this custom value record profile'));
}
}
$this->_duplicateButtonName = $this->getButtonName('upload', 'duplicate');
@@ -322,7 +322,7 @@ public function preProcess() {
// check if we are rendering mixed profiles
if (CRM_Core_BAO_UFGroup::checkForMixProfiles($this->_profileIds)) {
- CRM_Core_Error::fatal(ts('You cannot combine profiles of multiple types.'));
+ CRM_Core_Error::statusBounce(ts('You cannot combine profiles of multiple types.'));
}
// for now consider 1'st profile as primary profile and validate it
@@ -358,7 +358,7 @@ public function preProcess() {
}
if (empty($this->_ufGroup['is_active'])) {
- CRM_Core_Error::fatal(ts('The requested profile (gid=%1) is inactive or does not exist.', [
+ CRM_Core_Error::statusBounce(ts('The requested profile (gid=%1) is inactive or does not exist.', [
1 => $this->_gid,
]));
}
@@ -407,12 +407,12 @@ public function preProcess() {
if (!$this->_recordId
&& ($this->_multiRecord == CRM_Core_Action::UPDATE || $this->_multiRecord == CRM_Core_Action::DELETE)
) {
- CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) requires record id while performing this action',
+ CRM_Core_Error::statusBounce(ts('The requested Profile (gid=%1) requires record id while performing this action',
[1 => $this->_gid]
));
}
elseif (empty($this->_multiRecordFields)) {
- CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
+ CRM_Core_Error::statusBounce(ts('No Multi-Record Fields configured for this profile (gid=%1)',
[1 => $this->_gid]
));
}
diff --git a/CRM/Profile/Page/Dynamic.php b/CRM/Profile/Page/Dynamic.php
index 0ef7350a78d3..67f7edf0d508 100644
--- a/CRM/Profile/Page/Dynamic.php
+++ b/CRM/Profile/Page/Dynamic.php
@@ -237,7 +237,7 @@ public function run() {
if ($this->_isContactActivityProfile && $this->_gid) {
$errors = CRM_Profile_Form::validateContactActivityProfile($this->_activityId, $this->_id, $this->_gid);
if (!empty($errors)) {
- CRM_Core_Error::fatal(array_pop($errors));
+ CRM_Core_Error::statusBounce(array_pop($errors));
}
}
diff --git a/CRM/Profile/Page/Listings.php b/CRM/Profile/Page/Listings.php
index 46807507ce54..963d59b27fc8 100644
--- a/CRM/Profile/Page/Listings.php
+++ b/CRM/Profile/Page/Listings.php
@@ -100,7 +100,7 @@ public function preProcess() {
// check if we are rendering mixed profiles
if (CRM_Core_BAO_UFGroup::checkForMixProfiles($this->_profileIds)) {
- CRM_Core_Error::fatal(ts('You cannot combine profiles of multiple types.'));
+ CRM_Core_Error::statusBounce(ts('You cannot combine profiles of multiple types.'));
}
$this->_gid = $this->_profileIds[0];
@@ -282,7 +282,7 @@ public function run() {
$ufgroupDAO = new CRM_Core_DAO_UFGroup();
$ufgroupDAO->id = $this->_gid;
if (!$ufgroupDAO->find(TRUE)) {
- CRM_Core_Error::fatal();
+ CRM_Core_Error::statusBounce('Unable to find matching UF Group');
}
}
diff --git a/CRM/Profile/Page/View.php b/CRM/Profile/Page/View.php
index 0dbaf37bf0e4..e23fada8bd1d 100644
--- a/CRM/Profile/Page/View.php
+++ b/CRM/Profile/Page/View.php
@@ -49,7 +49,7 @@ public function preProcess() {
$session = CRM_Core_Session::singleton();
$this->_id = $session->get('userID');
if (!$this->_id) {
- CRM_Core_Error::fatal(ts('Could not find the required contact id parameter (id=) for viewing a contact record with a Profile.'));
+ CRM_Core_Error::statusBounce(ts('Could not find the required contact id parameter (id=) for viewing a contact record with a Profile.'));
}
}
$this->assign('cid', $this->_id);
@@ -66,7 +66,7 @@ public function preProcess() {
// check if we are rendering mixed profiles
if (CRM_Core_BAO_UFGroup::checkForMixProfiles($profileIds)) {
- CRM_Core_Error::fatal(ts('You cannot combine profiles of multiple types.'));
+ CRM_Core_Error::statusBounce(ts('You cannot combine profiles of multiple types.'));
}
$this->_gid = $profileIds[0];
diff --git a/CRM/Queue/Page/Runner.php b/CRM/Queue/Page/Runner.php
index 07ca85b1d0a2..ac46d87104ec 100644
--- a/CRM/Queue/Page/Runner.php
+++ b/CRM/Queue/Page/Runner.php
@@ -36,7 +36,7 @@ public function run() {
$qrid = CRM_Utils_Request::retrieve('qrid', 'String', $this, TRUE);
$runner = CRM_Queue_Runner::instance($qrid);
if (!is_object($runner)) {
- CRM_Core_Error::fatal('Queue runner must be configured before execution.');
+ CRM_Core_Error::statusBounce('Queue runner must be configured before execution.');
}
CRM_Utils_System::setTitle($runner->title);
diff --git a/CRM/Queue/Queue/Sql.php b/CRM/Queue/Queue/Sql.php
index 1258b533a852..3f6c474a9468 100644
--- a/CRM/Queue/Queue/Sql.php
+++ b/CRM/Queue/Queue/Sql.php
@@ -130,7 +130,7 @@ public function claimItem($lease_time = 3600) {
$dao = CRM_Core_DAO::executeQuery($sql, $params, TRUE, 'CRM_Queue_DAO_QueueItem');
if (is_a($dao, 'DB_Error')) {
// FIXME - Adding code to allow tests to pass
- CRM_Core_Error::fatal();
+ throw new CRM_Core_Exception('Unable to claim queue item');
}
if ($dao->fetch()) {
diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php
index 0d2b09e9b080..466278a3fa46 100644
--- a/CRM/UF/Page/ProfileEditor.php
+++ b/CRM/UF/Page/ProfileEditor.php
@@ -14,7 +14,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
* @throws \Exception
*/
public function run() {
- CRM_Core_Error::fatal('This is not a real page!');
+ throw new CRM_Core_Exception('This is not a real page!');
}
/**