MDL-39075 use html as default user description text format

This commit is contained in:
Petr Škoda 2013-04-12 22:08:26 +02:00
parent b3661ab272
commit 0c4c981f03
4 changed files with 18 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20130405" COMMENT="XMLDB file for core Moodle tables"
<XMLDB PATH="lib/db" VERSION="20130412" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
@ -782,7 +782,7 @@
<FIELD NAME="picture" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="0 means no image uploaded, positive values are revisions thta prevent caching problems, negative values are reserved for future use"/>
<FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="2" SEQUENCE="false"/>

View File

@ -1990,5 +1990,17 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013040300.01);
}
if ($oldversion < 2013041100.01) {
// Changing the default of field descriptionformat on table user to 1.
$table = new xmldb_table('user');
$field = new xmldb_field('descriptionformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1', 'description');
// Launch change of default for field descriptionformat.
$dbman->change_field_default($table, $field);
// Main savepoint reached.
upgrade_main_savepoint(true, 2013041100.01);
}
return true;
}

View File

@ -313,8 +313,9 @@ class core_user_external_testcase extends externallib_advanced_testcase {
if (!empty($generateduser->description)) {
$this->assertEquals($generateduser->description, $returneduser['description']);
}
if (!empty($generateduser->descriptionformat)) {
$this->assertEquals(FORMAT_HTML, $returneduser['descriptionformat']);
if (!empty($generateduser->descriptionformat) and isset($returneduser['descriptionformat'])) {
// All these tests look weird (skodak).
$this->assertEquals($generateduser->descriptionformat, $returneduser['descriptionformat']);
}
if (!empty($generateduser->city)) {
$this->assertEquals($generateduser->city, $returneduser['city']);

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013041100.00; // YYYYMMDD = weekly release date of this DEV branch
$version = 2013041100.01; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes