MDL-77037 core_courseformat: Refresh course index

* Refresh course index when language change
This commit is contained in:
Laurent David
2023-03-09 08:41:02 +01:00
parent 556208417d
commit 387371bacd
4 changed files with 64 additions and 0 deletions
+12
View File
@@ -226,6 +226,18 @@ abstract class base {
self::$instances = array();
}
}
/**
* Reset the current user for all courses.
*
* The course format cache resets every time the course cache resets but
* also when the user changes their language, all course editors
*
* @return void
*/
public static function session_cache_reset_all(): void {
$statecache = cache::make('core', 'courseeditorstate');
$statecache->purge();
}
/**
* Reset the current user course format cache.