From: Coleman Watts Date: Thu, 3 Jul 2014 20:06:51 +0000 (+0100) Subject: CRM-14931 - Nicer formating of statusBounce errors X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=50ecd41396edd789cd78ef0880a02e7b851cc688;p=civicrm-core.git CRM-14931 - Nicer formating of statusBounce errors --- diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index dce8a2e01d..8cddeac76d 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -827,12 +827,15 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @access public * @static */ - public static function statusBounce($status, $redirect = NULL, $title = '') { + public static function statusBounce($status, $redirect = NULL, $title = NULL) { $session = CRM_Core_Session::singleton(); if (!$redirect) { $redirect = $session->readUserContext(); } - $session->setStatus($status, $title); + if ($title === NULL) { + $title = ts('Error'); + } + $session->setStatus($status, $title, 'alert', array('expires' => 0)); if (CRM_Utils_Array::value('snippet', $_REQUEST) === CRM_Core_Smarty::PRINT_JSON) { CRM_Core_Page_AJAX::returnJsonResponse(array('status' => 'error')); }