diff --git a/mod/label/db/install.xml b/mod/label/db/install.xml index 7272a94ef3d..9257339ed75 100644 --- a/mod/label/db/install.xml +++ b/mod/label/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/label/db/upgrade.php b/mod/label/db/upgrade.php index 8c3d6602bb5..7aeae7727aa 100644 --- a/mod/label/db/upgrade.php +++ b/mod/label/db/upgrade.php @@ -43,6 +43,8 @@ // before any action that may take longer time to finish. function xmldb_label_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -66,5 +68,18 @@ function xmldb_label_upgrade($oldversion) { upgrade_mod_savepoint(true, 2025051300, 'label'); } + if ($oldversion < 2025051301) { + + // Changing precision of field name on table label to (1333). + $table = new xmldb_table('label'); + $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); + + // Label savepoint reached. + upgrade_mod_savepoint(true, 2025051301, 'label'); + } + return true; } diff --git a/mod/label/mod_form.php b/mod/label/mod_form.php index d96b6d87649..29bbc668288 100644 --- a/mod/label/mod_form.php +++ b/mod/label/mod_form.php @@ -39,13 +39,13 @@ class mod_label_mod_form extends moodleform_mod { $mform->addElement('header', 'generalhdr', get_string('general')); // Add element for name. - $mform->addElement('text', 'name', get_string('labelname', 'label'), ['size' => '64', 'maxlength' => 255]); + $mform->addElement('text', 'name', get_string('labelname', 'label'), ['size' => '64', 'maxlength' => 1333]); if (!empty($CFG->formatstringstriptags)) { $mform->setType('name', PARAM_TEXT); } else { $mform->setType('name', PARAM_CLEANHTML); } - $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); + $mform->addRule('name', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); $mform->addHelpButton('name', 'labelname', 'label'); $this->standard_intro_elements(get_string('labeltext', 'label')); diff --git a/mod/label/version.php b/mod/label/version.php index 93b3de54cf8..cac049eb4b1 100644 --- a/mod/label/version.php +++ b/mod/label/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2025051300; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2025051301; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;