Permalink
Browse files

MDL-32791 quiz db: clean up garbage data that was causing problems.

Melinda Kraft reported having rows in their quiz_question_instances
table which caused various problems. These rows are meaningless, so I
have done a DB upgrade step to clean them up, which should deal with the
bad side-effets they were causing.
  • Loading branch information...
1 parent dd9274c commit d4b3dd67ad44d58967f663c2523f498fcbe30adc @timhunt timhunt committed Jul 27, 2012
Showing with 12 additions and 1 deletion.
  1. +11 −0 mod/quiz/db/upgrade.php
  2. +1 −1 mod/quiz/version.php
View
@@ -1196,6 +1196,17 @@ function xmldb_quiz_upgrade($oldversion) {
// Moodle v2.2.0 release upgrade line
// Put any upgrade step following this
+ if ($oldversion < 2011112903) {
+
+ // MDL-32791 somebody reported having nonsense rows in their
+ // quiz_question_instances which caused various problems. These rows
+ // are meaningless, hence this upgrade step to clean them up.
+ $DB->delete_records('quiz_question_instances', array('question' => 0));
+
+ // Quiz savepoint reached.
+ upgrade_mod_savepoint(true, 2012061702, 'quiz');
+ }
+
return true;
}
View
@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
-$module->version = 2011112902; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2011112903; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->component = 'mod_quiz'; // Full name of the plugin (used for diagnostics)
$module->cron = 60;

0 comments on commit d4b3dd6

Please sign in to comment.