MDL-83542 core_course: Add hook for course content update

* Add hooks for course events that lead to session_cache_reset
This commit is contained in:
Laurent David
2025-02-07 11:52:39 +01:00
parent 139a0ad5f0
commit 25a963a5d7
7 changed files with 80 additions and 6 deletions
+5 -2
View File
@@ -127,8 +127,11 @@ class create_module extends external_api {
// Execute the action.
$actions->$action($updates, $course, $modname, $targetsectionnum, $targetcmid);
// Any state action mark the state cache as dirty.
course_format::session_cache_reset($course);
// Dispatch the hook for post course content update.
$hook = new \core_courseformat\hook\after_course_content_updated(
course: $course
);
\core\di::get(\core\hook\manager::class)->dispatch($hook);
return json_encode($updates);
}