Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "MDL-31914 Ensure that completion criteria are deleted when re…

…moving a course module"

This reverts commit 3bf0bb6.
  • Loading branch information...
commit bddec3c1d635edcc11345e157468284e966d8674 1 parent 9d0610f
@danpoltawski danpoltawski authored
Showing with 1 addition and 21 deletions.
  1. +0 −1  course/lib.php
  2. +0 −19 lib/db/upgrade.php
  3. +1 −1  version.php
View
1  course/lib.php
@@ -2856,7 +2856,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));
View
19 lib/db/upgrade.php
@@ -7030,25 +7030,6 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011120501.12);
}
- if ($oldversion < 2011120502.03) {
- // 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, 2011120502.03);
- }
-
-
return true;
}
View
2  version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011120502.03; // 20111205 = branching date YYYYMMDD - do not modify!
+$version = 2011120502.02; // 20111205 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.