<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="course" NEXT="intro"/>
<FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="introformat"/>
- <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="4" SEQUENCE="false" PREVIOUS="intro" NEXT="timemodified"/>
+ <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="intro" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="introformat"/>
</FIELDS>
<KEYS>
</INDEXES>
</TABLE>
</TABLES>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
/// Define field introformat to be added to label
$table = new xmldb_table('label');
- $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '4', 'intro');
+ $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0', 'intro');
/// Launch add field introformat
$dbman->add_field($table, $field);
upgrade_mod_savepoint($result, 2009042201, 'label');
}
+ if ($result && $oldversion < 2009080400) {
+
+ /// Define field introformat to be added to label
+ $table = new xmldb_table('label');
+ $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0', 'intro');
+
+ /// Launch add field introformat
+ $dbman->change_field_default($table, $field);
+
+ /// Convert existing markdown formats to 0 (due to an existing bug in early versions of label upgrade, defaulting to 4)
+ $DB->set_field('label', 'introformat', 0, array('introformat' => 4));
+
+ /// label savepoint reached
+ upgrade_mod_savepoint($result, 2009080400, 'label');
+ }
+
return $result;
}
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2009042201; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2009080400; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)