-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.5.5, 5.0
-
MOODLE_405_STABLE, MOODLE_500_STABLE
-
MDL-85419-main
-
-
I have an event observer for course_module_updated which checks the visibility. When the event is triggered I use `get_course_and_cm_from_cmid()` to get the cached course module.
Trouble is MDL-79615 allows for deferral of clearing the cache for bulk actions, and where this option is being used, the events are triggered before the cache is cleared. e.g https://github.com/moodle/moodle/blob/15b534da3ede9c3966f994e965ecac7361a21b7f/course/format/classes/stateactions.php#L502
This results in event observers like mine getting the wrong data from cache.
In these instances could we move the triggers until after the cache has been cleared?