MDL-38541 Restrict calling rebuild_course_cache() from upgrade process

only plugins upgrade scripts can call rebuild_course_cache() and for clearing cache only.
This commit is contained in:
Marina Glancy
2013-04-09 11:17:47 +10:00
parent 7d253e0977
commit 1d05ecfd3e
+6
View File
@@ -1279,6 +1279,12 @@ function get_fast_modinfo(&$course, $userid=0) {
function rebuild_course_cache($courseid=0, $clearonly=false) {
global $COURSE, $DB, $CFG;
if (!$clearonly && !empty($CFG->upgraderunning)) {
debugging('Function rebuild_course_cache() should not be called from upgrade script unless with argument clearonly.',
DEBUG_DEVELOPER);
$clearonly = true;
}
// Destroy navigation caches
navigation_cache::destroy_volatile_caches();