diff --git a/mod/resource/db/install.xml b/mod/resource/db/install.xml index c0ffb203c93..07218b49c73 100644 --- a/mod/resource/db/install.xml +++ b/mod/resource/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/resource/db/upgrade.php b/mod/resource/db/upgrade.php index c51086694ac..ce26d0f71c2 100644 --- a/mod/resource/db/upgrade.php +++ b/mod/resource/db/upgrade.php @@ -43,6 +43,9 @@ */ function xmldb_resource_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -58,5 +61,18 @@ function xmldb_resource_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 resource to (1333). + $table = new xmldb_table('resource'); + $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); + + // Resource savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'resource'); + } + return true; } diff --git a/mod/resource/mod_form.php b/mod/resource/mod_form.php index 0f1addfc00c..20bb3fbb183 100644 --- a/mod/resource/mod_form.php +++ b/mod/resource/mod_form.php @@ -54,7 +54,7 @@ class mod_resource_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(); $element = $mform->getElement('introeditor'); $attributes = $element->getAttributes(); diff --git a/mod/resource/version.php b/mod/resource/version.php index 50ff52cb6a0..be3a42ab9f5 100644 --- a/mod/resource/version.php +++ b/mod/resource/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_resource'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;