Status Check - Report the overall status (accurately) #24027
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
cc @seamuslee001 @mattwire
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:
civicrm/a/#/status
). The footer still uses ascending order!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 728c1cc). Theuasort()
withincheckAll()
is therefore redundant. We might as well skip it -- and simplify the logic.(The base-commit for this PR should be equally agreeable with
master
or5.52
.)