From: Andrew Hunt Date: Sun, 26 Apr 2015 17:24:39 +0000 (-0400) Subject: CRM-13823 Sort status messages by severity, name - even in API X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=47e2b515decf0a6a123093a46cd6cbc6c574809d;p=civicrm-core.git CRM-13823 Sort status messages by severity, name - even in API ---------------------------------------- * CRM-13823: Admin Status Page https://issues.civicrm.org/jira/browse/CRM-13823 --- diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index a0bdcfc048..f1ed405385 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -84,12 +84,11 @@ class CRM_Utils_Check { $statusMessages = array(); $statusType = 'alert'; - uasort($messages, array(__CLASS__, 'severitySort')); foreach ($messages as $message) { if ($filter === TRUE || call_user_func($filter, $message->getSeverity()) >= 3) { $statusType = (call_user_func($filter, $message->getSeverity()) >= 4) ? 'error' : $statusType; - $statusMessage = $message->getMessage(); - $statusMessages[] = $statusTitle = $message->getTitle(); + $statusMessage = $message->getMessage(); + $statusMessages[] = $statusTitle = $message->getTitle(); } } @@ -117,7 +116,7 @@ class CRM_Utils_Check { $aSeverity = $a->getSeverity(); $bSeverity = $b->getSeverity(); if ($aSeverity == $bSeverity) { - return 0; + return strcmp($a->getName(), $b->getName()); } return (self::severityMap($aSeverity) > self::severityMap($bSeverity)); } @@ -208,6 +207,8 @@ class CRM_Utils_Check { $messages[] = new CRM_Utils_Check_Message('ShowHushed', '

SHOWING HUSHED [NOT]

', 'Show Hushed', \Psr\Log\LogLevel::INFO); } + uasort($messages, array(__CLASS__, 'severitySort')); + return $messages; }