MDL-83985 mod_workshop: change name to 1333 chars

This commit is contained in:
Luca Bösch
2025-05-16 13:53:19 +02:00
parent 410f07f5c9
commit 19cc7dc5df
4 changed files with 20 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="mod/workshop/db" VERSION="20210302" COMMENT="XMLDB file for Moodle mod/workshop"
<XMLDB PATH="mod/workshop/db" VERSION="20250414" COMMENT="XMLDB file for Moodle mod/workshop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
@@ -8,7 +8,7 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="ID of the parent course"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Name of the activity"/>
<FIELD NAME="name" TYPE="char" LENGTH="1333" NOTNULL="true" SEQUENCE="false" COMMENT="Name of the activity"/>
<FIELD NAME="intro" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The introduction or description of the activity"/>
<FIELD NAME="introformat" TYPE="int" LENGTH="3" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="The format of the intro field"/>
<FIELD NAME="instructauthors" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="Instructions for the submission phase"/>
+16
View File
@@ -33,6 +33,9 @@
* @return bool result
*/
function xmldb_workshop_upgrade($oldversion) {
global $DB;
$dbman = $DB->get_manager();
// Automatically generated Moodle v4.2.0 release upgrade line.
// Put any upgrade step following this.
@@ -48,5 +51,18 @@ function xmldb_workshop_upgrade($oldversion) {
// Automatically generated Moodle v5.0.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2025041401) {
// Changing precision of field name on table workshop to (1333).
$table = new xmldb_table('workshop');
$field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'course');
// Launch change of precision for field name.
$dbman->change_field_precision($table, $field);
// Workshop savepoint reached.
upgrade_mod_savepoint(true, 2025041401, 'workshop');
}
return true;
}
+1 -1
View File
@@ -72,7 +72,7 @@ class mod_workshop_mod_form extends moodleform_mod {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$mform->addRule('name', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client');
// Introduction
$this->standard_intro_elements(get_string('introduction', 'workshop'));
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2025041400; // The current module version (YYYYMMDDXX).
$plugin->version = 2025041401; // The current module version (YYYYMMDDXX).
$plugin->requires = 2025040800; // Requires this Moodle version.
$plugin->component = 'mod_workshop';