Merge branch 'wip-MDL-38541-m24' of git://github.com/marinaglancy/moodle into MOODLE_24_STABLE
This commit is contained in:
+2
-2
@@ -1460,7 +1460,7 @@ function xmldb_main_upgrade($oldversion) {
|
||||
|
||||
if ($oldversion < 2012111200.01) {
|
||||
// Force the rebuild of the cache of every courses, some cached information could contain wrong icon references.
|
||||
rebuild_course_cache();
|
||||
$DB->execute('UPDATE {course} set modinfo = ?, sectioncache = ?', array(null, null));
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2012111200.01);
|
||||
@@ -1605,7 +1605,7 @@ function xmldb_main_upgrade($oldversion) {
|
||||
$DB->delete_records('course_sections_avail_fields', array('userfield' => 'interests'));
|
||||
$DB->delete_records('course_modules_avail_fields', array('userfield' => 'interests'));
|
||||
// Clear course cache (will be rebuilt on first visit) in case of changes to these.
|
||||
rebuild_course_cache(0, true);
|
||||
$DB->execute('UPDATE {course} set modinfo = ?, sectioncache = ?', array(null, null));
|
||||
|
||||
upgrade_main_savepoint(true, 2012120301.13);
|
||||
}
|
||||
|
||||
@@ -1360,6 +1360,12 @@ function get_fast_modinfo($courseorid, $userid = 0, $resetonly = false) {
|
||||
function rebuild_course_cache($courseid=0, $clearonly=false) {
|
||||
global $COURSE, $SITE, $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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user