Revert "Merge branch 'MDL-31914-master-4' of git://git.luns.net.uk/moodle"
This reverts commit296c0247c6, reversing changes made to2511b0742a. Conflicts: lib/db/upgrade.php version.php
This commit is contained in:
@@ -2929,7 +2929,6 @@ function delete_course_module($id) {
|
||||
// very quick on an empty table)
|
||||
$DB->delete_records('course_modules_completion', array('coursemoduleid' => $cm->id));
|
||||
$DB->delete_records('course_modules_availability', array('coursemoduleid'=> $cm->id));
|
||||
$DB->delete_records('course_completion_criteria', array('moduleinstance'=> $cm->id));
|
||||
|
||||
delete_context(CONTEXT_MODULE, $cm->id);
|
||||
return $DB->delete_records('course_modules', array('id'=>$cm->id));
|
||||
|
||||
@@ -317,24 +317,6 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2012031500.04);
|
||||
}
|
||||
|
||||
if ($oldversion < 2012032300.01) {
|
||||
// Delete orphaned criteria which were left when modules were removed
|
||||
if ($DB->get_dbfamily() === 'mysql') {
|
||||
$sql = "DELETE cc FROM {course_completion_criteria} cc
|
||||
LEFT JOIN {course_modules} cm ON cm.id = cc.moduleinstance
|
||||
WHERE cm.id IS NULL";
|
||||
} else {
|
||||
$sql = "DELETE FROM {course_completion_criteria}
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 'x' FROM {course_modules}
|
||||
WHERE {course_modules}.id = {course_completion_criteria}.moduleinstance)";
|
||||
}
|
||||
$DB->execute($sql);
|
||||
|
||||
// Main savepoint reached
|
||||
upgrade_main_savepoint(true, 2012032300.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2012032300.02) {
|
||||
// Migrate the old admin debug setting.
|
||||
if ($CFG->debug == 38911) {
|
||||
|
||||
Reference in New Issue
Block a user