dev/core#1932 - Make status-checks more polite during upgrade
authorTim Otten <totten@civicrm.org>
Thu, 6 Aug 2020 09:04:36 +0000 (02:04 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 6 Aug 2020 09:07:25 +0000 (02:07 -0700)
commitfdddbfae6d3492dd2c5f5b91d8309130a9e15900
treecb2f74cde12c9461beb4dd1a41a0d2fe58d45d2e
parent2baacb1762abf600f6c3dca38c368b5bb1c52cb0
dev/core#1932 - Make status-checks more polite during upgrade

Before
------

If you happen to run a status-check (eg `showPeriodicAlerts()`) in the interim between
downloading code and running DB upgrades, then you'll get weird failures.

After
-----

The status-checks are able to complete.

Technical Details
-----------------

(1) I figure that this conditional is lightweight because it relies on data
that's read-once and then cached in memory:

```
CRM_Utils_System::version() !== CRM_Core_BAO_Domain::version()
```

(2) The easiest way to reproduce is to get a DB from before 4.7 and coerce
`CRM_Utils_Check::CHECK_TIMER`.
CRM/Utils/Check/Component.php
CRM/Utils/Check/Component/Env.php
CRM/Utils/Check/Component/OptionGroups.php
CRM/Utils/Check/Message.php