Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38541 Restrict calling rebuild_course_cache() from upgrade process

only plugins upgrade scripts can call rebuild_course_cache() and for clearing cache only.
  • Loading branch information...
commit 1d05ecfd3e06e526d763a04db9a8ad06cabd7295 1 parent 7d253e0
@marinaglancy marinaglancy authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/modinfolib.php
View
6 lib/modinfolib.php
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.