quiz MDL-24727 column missed from install.xml
[moodle.git] / mod / quiz / db / upgrade.php
index 21290eb..ca78ed8 100644 (file)
@@ -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;
 }