Browse files

Disable the exercise module as it's not maintained or upgraded for roles

  • Loading branch information...
1 parent 1b19e81 commit e27a943788d3a49060eea9e553752c3836f4bdc0 moodler committed Oct 6, 2006
Showing with 18 additions and 1 deletion.
  1. +17 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
17 lib/db/upgrade.php
@@ -33,6 +33,23 @@ function xmldb_main_upgrade($oldversion=0) {
}
}
+ if ($oldversion < 2006100601) { /// Disable the exercise module because it's unmaintained
+ if ($module = get_record('modules', 'name', 'exercise')) {
+ if ($module->visible) {
+ // Hide/disable the module entry
+ set_field('modules', 'visible', '0', 'id', $module->id);
+ // Save existing visible state for all activities
+ set_field('course_modules', 'visibleold', '1', 'visible' ,'1', 'module', $module->id);
+ set_field('course_modules', 'visibleold', '0', 'visible' ,'0', 'module', $module->id);
+ // Hide all activities
+ set_field('course_modules', 'visible', '0', 'module', $module->id);
+
+ require_once($CFG->dirroot.'/course/lib.php');
+ rebuild_course_cache(); // Rebuld cache for all modules because they might have changed
+ }
+ }
+ }
+
return $result;
}
View
2 version.php
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2006100401; // YYYYMMDD = date
+ $version = 2006100601; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.7 dev'; // Human-friendly version name

0 comments on commit e27a943

Please sign in to comment.