-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.1, 4.1.1
-
MOODLE_401_STABLE
We run the unit tests for accesslib and all the test connected to get_deprecated_capability failed. Doing some failure research we figured out following problem: In a local plugin we observe the event \core\event\course_created and by doing so cause a capability check.
Taking as an example the test methode test_get_deprecated_capability_info(): This leads to that after $this->setup_fake_plugin('access') the flag 'deprecated_capabilities_initialised' in the cache ('core', 'deprecatedcapabilities') being already set to true before the intended setup of the test, which should happen in the call of get_deprecated_capability_info('fake/access:fakecapability').
So these unit tests fail because the new deprecated capabilities of the fake_plugin are not in the deprecatedcapabilities cache.
Maybe function update_capabilities() should note this change. It flushes the cache ('core', 'capabilities') four times:
cache::make('core', 'capabilities')->delete('core_capabilities');
but never
cache::make('core', 'deprecatedcapabilities')->delete('deprecated_capabilities_initialised');
- has been marked as being related by
-
MDL-78297 Deprecated capabilities feature puts high pressure on caches
-
- Closed
-