diff --git a/mod/lesson/db/install.xml b/mod/lesson/db/install.xml index 99d3d9b8f18..88080ff4782 100644 --- a/mod/lesson/db/install.xml +++ b/mod/lesson/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/lesson/db/upgrade.php b/mod/lesson/db/upgrade.php index 8ed5c56b104..ca1ff559f7e 100644 --- a/mod/lesson/db/upgrade.php +++ b/mod/lesson/db/upgrade.php @@ -48,6 +48,9 @@ * @return bool */ function xmldb_lesson_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -63,5 +66,18 @@ function xmldb_lesson_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 lesson to (1333). + $table = new xmldb_table('lesson'); + $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); + + // Lesson savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'lesson'); + } + return true; } diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index d10eb90cfe6..ec95d1e46e3 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -94,7 +94,7 @@ class mod_lesson_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'); $this->standard_intro_elements(); // Appearance. diff --git a/mod/lesson/version.php b/mod/lesson/version.php index 01883382960..acd093762ed 100644 --- a/mod/lesson/version.php +++ b/mod/lesson/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2025041400; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2025041401; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'mod_lesson'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;