diff --git a/mod/workshop/db/install.xml b/mod/workshop/db/install.xml index d9e72cf0e73..4b996902ffa 100644 --- a/mod/workshop/db/install.xml +++ b/mod/workshop/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/workshop/db/upgrade.php b/mod/workshop/db/upgrade.php index 8f53c6bff63..0036d1a75de 100644 --- a/mod/workshop/db/upgrade.php +++ b/mod/workshop/db/upgrade.php @@ -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; } diff --git a/mod/workshop/mod_form.php b/mod/workshop/mod_form.php index bf52e4cf4a2..f2301436080 100644 --- a/mod/workshop/mod_form.php +++ b/mod/workshop/mod_form.php @@ -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')); diff --git a/mod/workshop/version.php b/mod/workshop/version.php index c110ec0ccd3..95f50b6fb41 100644 --- a/mod/workshop/version.php +++ b/mod/workshop/version.php @@ -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';