MDL-41436 Removing references to fields course.modinfo, sectioncache

Also add the field cacherev to the lists of default fields in course retrieval functions
This commit is contained in:
Marina Glancy
2013-09-10 14:11:51 +10:00
parent 299cfee5f2
commit 4a3fb71c4f
12 changed files with 31 additions and 37 deletions
+6 -6
View File
@@ -194,13 +194,13 @@ function uninstall_plugin($type, $name) {
}
}
// clear course.modinfo for courses that used this module
$sql = "UPDATE {course}
SET modinfo=''
WHERE id IN (SELECT DISTINCT course
// Increment course.cacherev for courses that used this module.
// This will force cache rebuilding on the next request.
increment_revision_number('course', 'cacherev',
"id IN (SELECT DISTINCT course
FROM {course_modules}
WHERE module=?)";
$DB->execute($sql, array($module->id));
WHERE module=?)",
array($module->id));
// delete all the course module records
$DB->delete_records('course_modules', array('module' => $module->id));