Status Check - Report the overall status (accurately)
Overview
--------
The page-footer includes a summary message about the system status (eg "System
Status: Ok" or "System Status: Error"). The footer has inaccurately summarized
the status.
Before
------
Suppose you have 5 "Error" messages and 1 "OK" message. It will summarize as "System Status: Ok".
(It emphasizes the *least severe* status-message.)
Code is more complex.
After
------
Suppose you have 5 "Error" messages and 1 "OK" message. It will summarize as "System Status: Error".
(It emphasizes the *most severe* status-message.)
Code is less complex.
Comments
--------
The overall value is determined in `CRM_Utils_Check::checkAll()`. Heretofore,
`checkAll()` sorted the messages by severity and then emphasized the *first*
visible message.
The problem is that the sort-order has flip-flopped, so "first" means different things:
* In v4.7, the messages were descending. So "first" was "most severe".
* In v5.39 (
11d593edde82e7de962ec9056cfebe87975fb499), the order was ascending.
So "first" was "least severe". (It appears accidental.)
* In v5.45 (
728c1cc31d0d323f74f7b980a1e183fb499d4e9e), the order flipped back
to descending, but *only* for the Angular (`civicrm/a/#/status`) -- not the footer.
IMHO, the flip-floppiness means that callers cannot rely on the order returned
by `checkAll()` -- they should instead do a higher-level sort (as in v5.45's
728c1cc31d0d323f74f7b980a1e183fb499d4e9e). The `uasort()` within `checkAll()`
is therefore redundant. We might as well skip it -- and simplify the logic.