Skip to content

Commit

Permalink
MDL-38541 Restrict calling rebuild_course_cache() from upgrade process
Browse files Browse the repository at this point in the history
only plugins upgrade scripts can call rebuild_course_cache() and for clearing cache only.
  • Loading branch information
marinaglancy committed Apr 9, 2013
1 parent 7d253e0 commit 1d05ecf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/modinfolib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 1d05ecf

Please sign in to comment.