From 9bb6663e04130981359c9dc7f51f29056d64fd7f Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 20 Oct 2010 10:14:19 +0000 Subject: [PATCH] quiz MDL-24727 column missed from install.xml --- mod/quiz/db/install.xml | 3 ++- mod/quiz/db/upgrade.php | 21 ++++++++++++++++++--- mod/quiz/version.php | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/mod/quiz/db/install.xml b/mod/quiz/db/install.xml index 2196e070142..a8b41442595 100755 --- a/mod/quiz/db/install.xml +++ b/mod/quiz/db/install.xml @@ -35,7 +35,8 @@ - + + diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index 21290ebaf3c..ca78ed81fe3 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -328,16 +328,16 @@ function xmldb_quiz_upgrade($oldversion) { if ($oldversion < 2010051800) { - /// Define field showblocks to be added to quiz + // Define field showblocks to be added to quiz $table = new xmldb_table('quiz'); $field = new xmldb_field('showblocks', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'showuserpicture'); - /// Conditionally launch add field showblocks + // Conditionally launch add field showblocks if (!$dbman->field_exists($table, $field)) { $dbman->add_field($table, $field); } - /// quiz savepoint reached + // quiz savepoint reached upgrade_mod_savepoint(true, 2010051800, 'quiz'); } @@ -356,6 +356,21 @@ function xmldb_quiz_upgrade($oldversion) { upgrade_mod_savepoint(true, 2010080600, 'quiz'); } + if ($oldversion < 2010102000) { + + // Define field showblocks to be added to quiz + // Repeat this step, because the column was missing from install.xml for a time. + $table = new xmldb_table('quiz'); + $field = new xmldb_field('showblocks', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'showuserpicture'); + + // Conditionally launch add field showblocks + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // quiz savepoint reached + upgrade_mod_savepoint(true, 2010102000, 'quiz'); + } return true; } diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 9cc23d75bea..6ff57931c24 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -5,7 +5,7 @@ // This fragment is called by moodle_needs_upgrading() and /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2010080600; // The (date) version of this module +$module->version = 2010102000; // The (date) version of this module $module->requires = 2010080300; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)? -- 2.43.0