AfformScanner - Simplify cache. Fix CLI/web sync bug.
authorTim Otten <totten@civicrm.org>
Fri, 20 Dec 2019 07:41:10 +0000 (23:41 -0800)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:20 +0000 (19:13 -0700)
commitd676549aea2519b3092100737bb924438823ef10
treec9cfb1499a288256716a4a90d30377ae9e754f6f
parent2d4bfef17400f129975d5c3b6bf0122e7161a3ef
AfformScanner - Simplify cache. Fix CLI/web sync bug.

Example bug:

1. Find a packaged (non-overriden) form - e.g. `mockPage`
2. Run `cv api4 Afform.update +w name=mockPage +v permissions='*always allow*'
3. Run `curl http://localhost/civicrm/mock-page`
4. Observe: the page-load fails even though the permissions say it should work

The call to `Afform.update` should trigger a cache-clear, but it only fixes
on the CLI...  because the CLI and web have different runtime IDs.

The runtime-id was included preventively in anticipation that oddball
multisite arrangements might need to store these things separately.  But I
think it's overdone, because the runtime-ID factors in things like
`SCRIPT_FILENAME` which has no bearing on the whether to use the same cache.

Let's KISS and *if* there's any kind of multisite issue, then we can revisit.
ext/afform/core/CRM/Afform/AfformScanner.php