CRM-14931 - Nicer formating of statusBounce errors
authorColeman Watts <coleman@civicrm.org>
Thu, 3 Jul 2014 20:06:51 +0000 (21:06 +0100)
committerColeman Watts <coleman@civicrm.org>
Thu, 3 Jul 2014 20:06:51 +0000 (21:06 +0100)
CRM/Core/Error.php

index dce8a2e01d6b5dc8803779422505d3d48a6c2b54..8cddeac76de4fd4368373875500b3ab30e730bdc 100644 (file)
@@ -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'));
     }