mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-72991 Course: Modify the courseminfo cacheid to force a rebuild
Co-authored-by: Andrew Lyons <andrew@nicols.co.uk>
This commit is contained in:
parent
f97b86e841
commit
4bc2b24a51
1 changed files with 3 additions and 0 deletions
|
@ -733,6 +733,7 @@ class course_modinfo {
|
|||
if ($coursemodinfo !== false) {
|
||||
foreach ($coursemodinfo->sectioncache as $sectionno => $sectioncache) {
|
||||
if ($sectioncache->id == $sectionid) {
|
||||
$coursemodinfo->cacherev = -1;
|
||||
unset($coursemodinfo->sectioncache[$sectionno]);
|
||||
$cache->set($courseid, $coursemodinfo);
|
||||
break;
|
||||
|
@ -753,6 +754,7 @@ class course_modinfo {
|
|||
$cache->acquire_lock($courseid);
|
||||
$coursemodinfo = $cache->get($courseid);
|
||||
if ($coursemodinfo !== false && array_key_exists($sectionno, $coursemodinfo->sectioncache)) {
|
||||
$coursemodinfo->cacherev = -1;
|
||||
unset($coursemodinfo->sectioncache[$sectionno]);
|
||||
$cache->set($courseid, $coursemodinfo);
|
||||
}
|
||||
|
@ -771,6 +773,7 @@ class course_modinfo {
|
|||
$coursemodinfo = $cache->get($courseid);
|
||||
$hascache = ($coursemodinfo !== false) && array_key_exists($cmid, $coursemodinfo->modinfo);
|
||||
if ($hascache) {
|
||||
$coursemodinfo->cacherev = -1;
|
||||
unset($coursemodinfo->modinfo[$cmid]);
|
||||
$cache->set($courseid, $coursemodinfo);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue