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.
public function __construct() {
// TODO Manage this is a service, and inject the cache service.
$this->cache = new CRM_Utils_Cache_SqlGroup([
- 'group' => md5('afform_' . CRM_Core_Config_Runtime::getId() . $this->getSiteLocalPath()),
+ // Note: If there are edge-case bugs with multisite, consider changing
+ // the group key - but tread carefully to ensure that (eg) CLI+web workers
+ // see the same cache.
+ 'group' => 'afform_scanner',
'prefetch' => FALSE,
]);
// $this->cache = new CRM_Utils_Cache_Arraycache([]);