Skip to content

Commit

Permalink
Revert "Merge branch 'MDL-31914-master-4' of git://git.luns.net.uk/mo…
Browse files Browse the repository at this point in the history
…odle"

This reverts commit 296c024, reversing
changes made to 2511b07.

Conflicts:

	lib/db/upgrade.php
	version.php
  • Loading branch information
danpoltawski committed Mar 29, 2012
1 parent 3f0cb42 commit a405135
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
18 changes: 0 additions & 18 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a405135

Please sign in to comment.