Rebuild course modinfo caches to include the visible variable

This commit is contained in:
moodler
2003-04-23 17:02:24 +00:00
parent 7acaa63d09
commit 13df5aeef3
3 changed files with 28 additions and 1 deletions
+13
View File
@@ -61,6 +61,19 @@ function main_upgrade($oldversion=0) {
}
}
if ($oldversion < 2003042400) {
// Rebuild all course caches, because of changes to do with visible variable
if ($courses = get_records_sql("SELECT * FROM {$CFG->prefix}course")) {
require_once("$CFG->dirroot/course/lib.php");
foreach ($courses as $course) {
$modinfo = serialize(get_array_of_activities($course->id));
if (!set_field("course", "modinfo", $modinfo, "id", $course->id)) {
notify("Could not cache module information for course '$course->fullname'!");
}
}
}
}
return true;
}