diff --git a/admin/tool/recyclebin/db/install.xml b/admin/tool/recyclebin/db/install.xml index 8aa6c9d45b8..2a16ee56ee5 100644 --- a/admin/tool/recyclebin/db/install.xml +++ b/admin/tool/recyclebin/db/install.xml @@ -1,5 +1,5 @@ - @@ -10,7 +10,7 @@ - + @@ -25,7 +25,7 @@ - + diff --git a/admin/tool/recyclebin/db/upgrade.php b/admin/tool/recyclebin/db/upgrade.php index 4500ce60923..d834688535f 100644 --- a/admin/tool/recyclebin/db/upgrade.php +++ b/admin/tool/recyclebin/db/upgrade.php @@ -45,21 +45,36 @@ function xmldb_tool_recyclebin_upgrade($oldversion) { // Automatically generated Moodle v4.5.0 release upgrade line. // Put any upgrade step following this. - if ($oldversion < 2024111500) { - // Changing precision of field fullname on table tool_recyclebin_category to (255). + // Automatically generated Moodle v5.0.0 release upgrade line. + // Put any upgrade step following this. + + if ($oldversion < 2025041401) { + + // Changing precision of field shortname on table tool_recyclebin_category to (1333). + $table = new xmldb_table('tool_recyclebin_category'); + $field = new xmldb_field('shortname', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'categoryid'); + + // Launch change of precision for field shortname. + $dbman->change_field_precision($table, $field); + + // Changing precision of field fullname on table tool_recyclebin_category to (1333). $table = new xmldb_table('tool_recyclebin_category'); $field = new xmldb_field('fullname', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'shortname'); // Launch change of precision for field fullname. $dbman->change_field_precision($table, $field); - // Recyclebin savepoint reached. - upgrade_plugin_savepoint(true, 2024111500, 'tool', 'recyclebin'); - } + // Changing precision of field name on table tool_recyclebin_course to (1333). + $table = new xmldb_table('tool_recyclebin_course'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'module'); - // Automatically generated Moodle v5.0.0 release upgrade line. - // Put any upgrade step following this. + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Recyclebin savepoint reached. + upgrade_plugin_savepoint(true, 2025041401, 'tool', 'recyclebin'); + } return true; } diff --git a/admin/tool/recyclebin/version.php b/admin/tool/recyclebin/version.php index ac47303254a..cfc2d10c22a 100644 --- a/admin/tool/recyclebin/version.php +++ b/admin/tool/recyclebin/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2025041400; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2025041401; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'tool_recyclebin'; // Full name of the plugin (used for diagnostics). diff --git a/badges/classes/form/badge.php b/badges/classes/form/badge.php index 683678b1328..4a27ba583d5 100644 --- a/badges/classes/form/badge.php +++ b/badges/classes/form/badge.php @@ -58,7 +58,7 @@ class badge extends moodleform { // When downloading badge, it will be necessary to clean the name as PARAM_FILE. $mform->setType('name', PARAM_TEXT); $mform->addRule('name', null, 'required'); - $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); + $mform->addRule('name', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); $mform->addElement('text', 'version', get_string('version', 'badges'), ['size' => '70']); $mform->setType('version', PARAM_TEXT); @@ -97,6 +97,7 @@ class badge extends moodleform { $mform->addElement('text', 'issuername', get_string('issuername', 'badges'), ['size' => '70']); $mform->setType('issuername', PARAM_NOTAGS); $mform->addRule('issuername', null, 'required'); + $mform->addRule('issuername', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); $site = get_site(); $issuername = $CFG->badges_defaultissuername ?: $site->fullname; $mform->setDefault('issuername', $issuername); diff --git a/course/editsection_form.php b/course/editsection_form.php index 4ea413b5f3e..5263b02cc53 100644 --- a/course/editsection_form.php +++ b/course/editsection_form.php @@ -37,7 +37,7 @@ class editsection_form extends moodleform { ); $mform->setType('name', PARAM_RAW); $mform->setDefault('name', $sectioninfo->name); - $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); + $mform->addRule('name', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); /// Prepare course and the editor diff --git a/course/format/classes/local/sectionactions.php b/course/format/classes/local/sectionactions.php index ec8cee7ce61..41f56bb4370 100644 --- a/course/format/classes/local/sectionactions.php +++ b/course/format/classes/local/sectionactions.php @@ -353,8 +353,8 @@ class sectionactions extends baseactions { // Some fields can not be updated using this method. $fields = array_diff_key((array) $fields, array_flip(['id', 'course', 'section', 'sequence'])); - if (array_key_exists('name', $fields) && \core_text::strlen($fields['name']) > 255) { - throw new \moodle_exception('maximumchars', 'moodle', '', 255); + if (array_key_exists('name', $fields) && \core_text::strlen($fields['name']) > 1333) { + throw new \moodle_exception('maximumchars', 'moodle', '', 1333); } // If the section is delegated to a component, it may control some section values. diff --git a/course/format/tests/local/sectionactions_test.php b/course/format/tests/local/sectionactions_test.php index 9d159c577db..b1d2b62a7df 100644 --- a/course/format/tests/local/sectionactions_test.php +++ b/course/format/tests/local/sectionactions_test.php @@ -646,7 +646,7 @@ final class sectionactions_test extends \advanced_testcase { ], 'Long names throws and exception' => [ 'fieldname' => 'name', - 'value' => str_repeat('a', 256), + 'value' => str_repeat('a', 1334), 'expected' => '=', 'expectexception' => true, ], diff --git a/lib/db/install.xml b/lib/db/install.xml index 76b82d3f678..e253b79a330 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -380,7 +380,7 @@ - + @@ -1991,7 +1991,7 @@ - + @@ -3173,13 +3173,13 @@ - + - + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 999ce1beb03..d8209a65ead 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1684,5 +1684,43 @@ function xmldb_main_upgrade($oldversion) { // Automatically generated Moodle v5.0.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2025051600.01) { + + // Changing precision of field name on table badge to (1333). + + $table = new xmldb_table('badge'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'id'); + + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Changing precision of field issuername on table badge to (1333). + + $table = new xmldb_table('badge'); + $field = new xmldb_field('issuername', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'usermodified'); + + // Launch change of precision for field issuername. + $dbman->change_field_precision($table, $field); + + // Changing precision of field name on table course_sections to (1333). + + $table = new xmldb_table('course_sections'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'section'); + + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Changing precision of field itemname on table grade_items to (1333). + + $table = new xmldb_table('grade_items'); + $field = new xmldb_field('itemname', XMLDB_TYPE_CHAR, '1333', null, null, null, null, 'categoryid'); + + // Launch change of precision for field itemname. + $dbman->change_field_precision($table, $field); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2025051600.01); + } + return true; } diff --git a/mod/assign/db/install.xml b/mod/assign/db/install.xml index 2c630023a1f..da3b2765b7e 100644 --- a/mod/assign/db/install.xml +++ b/mod/assign/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/assign/db/upgrade.php b/mod/assign/db/upgrade.php index 30ddfd1cc6a..d9f6304192f 100644 --- a/mod/assign/db/upgrade.php +++ b/mod/assign/db/upgrade.php @@ -144,5 +144,18 @@ function xmldb_assign_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 assign to (1333). + $table = new xmldb_table('assign'); + $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); + + // Assign savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'assign'); + } + return true; } diff --git a/mod/assign/mod_form.php b/mod/assign/mod_form.php index 801ba2be07c..f4ea6d45ee2 100644 --- a/mod/assign/mod_form.php +++ b/mod/assign/mod_form.php @@ -54,7 +54,7 @@ class mod_assign_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(get_string('description', 'assign')); diff --git a/mod/assign/version.php b/mod/assign/version.php index 021d12fd36b..6adf6880684 100644 --- a/mod/assign/version.php +++ b/mod/assign/version.php @@ -25,5 +25,5 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_assign'; // Full name of the plugin (used for diagnostics). -$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. diff --git a/mod/bigbluebuttonbn/db/install.xml b/mod/bigbluebuttonbn/db/install.xml index fa500321ba0..44170b27aaf 100644 --- a/mod/bigbluebuttonbn/db/install.xml +++ b/mod/bigbluebuttonbn/db/install.xml @@ -1,5 +1,5 @@ - @@ -9,7 +9,7 @@ - + diff --git a/mod/bigbluebuttonbn/db/upgrade.php b/mod/bigbluebuttonbn/db/upgrade.php index 9e7439a88ff..e177abc250c 100644 --- a/mod/bigbluebuttonbn/db/upgrade.php +++ b/mod/bigbluebuttonbn/db/upgrade.php @@ -83,6 +83,20 @@ function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) { // 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 bigbluebuttonbn to (1333). + + $table = new xmldb_table('bigbluebuttonbn'); + $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); + + // Bigbluebuttonbn savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'bigbluebuttonbn'); + } + return true; } diff --git a/mod/bigbluebuttonbn/version.php b/mod/bigbluebuttonbn/version.php index 6df3778e96c..e299e9ab803 100644 --- a/mod/bigbluebuttonbn/version.php +++ b/mod/bigbluebuttonbn/version.php @@ -27,6 +27,6 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2025041400; +$plugin->version = 2025041401; $plugin->requires = 2025040800; $plugin->component = 'mod_bigbluebuttonbn'; diff --git a/mod/book/db/install.xml b/mod/book/db/install.xml index b991b1b18be..684ad66485b 100644 --- a/mod/book/db/install.xml +++ b/mod/book/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/mod/book/db/upgrade.php b/mod/book/db/upgrade.php index 77f2186e2b3..613c895102a 100644 --- a/mod/book/db/upgrade.php +++ b/mod/book/db/upgrade.php @@ -28,6 +28,9 @@ * @return bool always true */ function xmldb_book_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -43,5 +46,25 @@ function xmldb_book_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 book to (1333). + $table = new xmldb_table('book'); + $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); + + // Changing precision of field title on table book_chapters to (1333). + $table = new xmldb_table('book_chapters'); + $field = new xmldb_field('title', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'subchapter'); + + // Launch change of precision for field title. + $dbman->change_field_precision($table, $field); + + // Book savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'book'); + } + return true; } diff --git a/mod/book/edit_form.php b/mod/book/edit_form.php index 52b5d7b1cc1..439b67d05f0 100644 --- a/mod/book/edit_form.php +++ b/mod/book/edit_form.php @@ -56,10 +56,10 @@ class book_chapter_edit_form extends moodleform { } $mform->addElement('text', 'title', get_string('chaptertitle', 'mod_book'), - ['size' => '30', 'maxlength' => '255']); + ['size' => '30', 'maxlength' => '1333']); $mform->setType('title', PARAM_RAW); $mform->addRule('title', null, 'required', null, 'client'); - $mform->addRule('title', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); + $mform->addRule('title', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); $mform->addElement('advcheckbox', 'subchapter', get_string('subchapter', 'mod_book'), $disabledmsg); diff --git a/mod/book/mod_form.php b/mod/book/mod_form.php index dd87bb65665..cbc03216204 100644 --- a/mod/book/mod_form.php +++ b/mod/book/mod_form.php @@ -45,7 +45,7 @@ class mod_book_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(get_string('moduleintro')); // Appearance. diff --git a/mod/book/version.php b/mod/book/version.php index 7f2977851ce..985b87fd54e 100644 --- a/mod/book/version.php +++ b/mod/book/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die; $plugin->component = 'mod_book'; // Full name of the plugin (used for diagnostics) -$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->cron = 0; // Period for cron to check this module (secs) diff --git a/mod/choice/db/install.xml b/mod/choice/db/install.xml index aafb4cbb3d1..1c7cee36001 100644 --- a/mod/choice/db/install.xml +++ b/mod/choice/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/choice/db/upgrade.php b/mod/choice/db/upgrade.php index 21a9cb16c6b..727b7852160 100644 --- a/mod/choice/db/upgrade.php +++ b/mod/choice/db/upgrade.php @@ -40,6 +40,9 @@ */ function xmldb_choice_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -55,5 +58,18 @@ function xmldb_choice_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 choice to (1333). + $table = new xmldb_table('choice'); + $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); + + // Choice savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'choice'); + } + return true; } diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index 7acc4f76246..bc92844b63c 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -22,7 +22,7 @@ class mod_choice_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(get_string('description', 'choice')); diff --git a/mod/choice/version.php b/mod/choice/version.php index b810db48af5..3703f4d5033 100644 --- a/mod/choice/version.php +++ b/mod/choice/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_choice'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/data/db/install.xml b/mod/data/db/install.xml index a9c9de292d1..9b7712d8313 100644 --- a/mod/data/db/install.xml +++ b/mod/data/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/data/db/upgrade.php b/mod/data/db/upgrade.php index b4fb3dc4a8b..881dd8c0f94 100644 --- a/mod/data/db/upgrade.php +++ b/mod/data/db/upgrade.php @@ -41,6 +41,7 @@ function xmldb_data_upgrade($oldversion) { global $DB; + $dbman = $DB->get_manager(); // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -73,5 +74,18 @@ function xmldb_data_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 data to (1333). + $table = new xmldb_table('data'); + $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); + + // Data savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'data'); + } + return true; } diff --git a/mod/data/mod_form.php b/mod/data/mod_form.php index ec36f8e5c5d..0bfd42980a6 100644 --- a/mod/data/mod_form.php +++ b/mod/data/mod_form.php @@ -22,7 +22,7 @@ class mod_data_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(get_string('intro', 'data')); diff --git a/mod/data/version.php b/mod/data/version.php index 20e8780faa9..f54aa03c316 100644 --- a/mod/data/version.php +++ b/mod/data/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_data'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/feedback/db/install.xml b/mod/feedback/db/install.xml index 971492e6bf0..d01f8fffa14 100644 --- a/mod/feedback/db/install.xml +++ b/mod/feedback/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/mod/feedback/db/upgrade.php b/mod/feedback/db/upgrade.php index ef71cdd5f5a..5a791232f22 100644 --- a/mod/feedback/db/upgrade.php +++ b/mod/feedback/db/upgrade.php @@ -40,6 +40,9 @@ */ function xmldb_feedback_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -55,5 +58,25 @@ function xmldb_feedback_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 feedback to (1333). + $table = new xmldb_table('feedback'); + $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); + + // Changing precision of field name on table feedback_item to (1333). + $table = new xmldb_table('feedback_item'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'template'); + + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Feedback savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'feedback'); + } + return true; } diff --git a/mod/feedback/item/captcha/captcha_form.php b/mod/feedback/item/captcha/captcha_form.php index a1c8196c937..04cdfe86120 100644 --- a/mod/feedback/item/captcha/captcha_form.php +++ b/mod/feedback/item/captcha/captcha_form.php @@ -33,7 +33,7 @@ class feedback_captcha_form extends feedback_item_form { $mform->addElement('text', 'name', get_string('item_name', 'feedback'), - array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); + ['size' => FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength' => 1333]); $mform->addElement('text', 'label', get_string('item_label', 'feedback'), diff --git a/mod/feedback/item/info/info_form.php b/mod/feedback/item/info/info_form.php index 82c8e73a8b8..c3476bee169 100644 --- a/mod/feedback/item/info/info_form.php +++ b/mod/feedback/item/info/info_form.php @@ -39,7 +39,7 @@ class feedback_info_form extends feedback_item_form { $mform->addElement('text', 'name', get_string('item_name', 'feedback'), - array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); + ['size' => FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength' => 1333]); $mform->addElement('text', 'label', get_string('item_label', 'feedback'), diff --git a/mod/feedback/item/numeric/numeric_form.php b/mod/feedback/item/numeric/numeric_form.php index 67ca0192093..fd685bdcd73 100644 --- a/mod/feedback/item/numeric/numeric_form.php +++ b/mod/feedback/item/numeric/numeric_form.php @@ -34,7 +34,7 @@ class feedback_numeric_form extends feedback_item_form { $mform->addElement('text', 'name', get_string('item_name', 'feedback'), - array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); + ['size' => FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength' => 1333]); $mform->addElement('text', 'label', get_string('item_label', 'feedback'), diff --git a/mod/feedback/item/textarea/textarea_form.php b/mod/feedback/item/textarea/textarea_form.php index 0a777e73805..5888c4cb381 100644 --- a/mod/feedback/item/textarea/textarea_form.php +++ b/mod/feedback/item/textarea/textarea_form.php @@ -33,7 +33,7 @@ class feedback_textarea_form extends feedback_item_form { $mform->addElement('text', 'name', get_string('item_name', 'feedback'), - array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); + ['size' => FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength' => 1333]); $mform->addElement('text', 'label', get_string('item_label', 'feedback'), diff --git a/mod/feedback/item/textfield/textfield_form.php b/mod/feedback/item/textfield/textfield_form.php index a042bd20c71..3d4459e302c 100644 --- a/mod/feedback/item/textfield/textfield_form.php +++ b/mod/feedback/item/textfield/textfield_form.php @@ -33,7 +33,7 @@ class feedback_textfield_form extends feedback_item_form { $mform->addElement('text', 'name', get_string('item_name', 'feedback'), - array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); + ['size' => FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength' => 1333]); $mform->addElement('text', 'label', get_string('item_label', 'feedback'), diff --git a/mod/feedback/mod_form.php b/mod/feedback/mod_form.php index 84fdfb70445..bb56ad9aac1 100644 --- a/mod/feedback/mod_form.php +++ b/mod/feedback/mod_form.php @@ -44,7 +44,7 @@ class mod_feedback_mod_form extends moodleform_mod { $mform->addElement('text', 'name', get_string('name', 'feedback'), array('size'=>'64')); $mform->setType('name', PARAM_TEXT); $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(get_string('description', 'feedback')); diff --git a/mod/feedback/version.php b/mod/feedback/version.php index fd241b3fcfc..345d4df2b51 100644 --- a/mod/feedback/version.php +++ b/mod/feedback/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_feedback'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/folder/db/install.xml b/mod/folder/db/install.xml index 54bd1e27504..e6ec9f080f3 100644 --- a/mod/folder/db/install.xml +++ b/mod/folder/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/folder/db/upgrade.php b/mod/folder/db/upgrade.php index 2a31a648b9b..6c7505e63c1 100644 --- a/mod/folder/db/upgrade.php +++ b/mod/folder/db/upgrade.php @@ -43,6 +43,9 @@ */ function xmldb_folder_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_folder_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 folder to (1333). + $table = new xmldb_table('folder'); + $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); + + // Folder savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'folder'); + } + return true; } diff --git a/mod/folder/mod_form.php b/mod/folder/mod_form.php index 85156d25130..0cb0b2a8d10 100644 --- a/mod/folder/mod_form.php +++ b/mod/folder/mod_form.php @@ -43,7 +43,7 @@ class mod_folder_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(); //------------------------------------------------------- diff --git a/mod/folder/version.php b/mod/folder/version.php index b2b4f18fec8..288346510d4 100644 --- a/mod/folder/version.php +++ b/mod/folder/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_folder'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/forum/db/install.xml b/mod/forum/db/install.xml index ed437491d83..7e4b9edc843 100644 --- a/mod/forum/db/install.xml +++ b/mod/forum/db/install.xml @@ -1,5 +1,5 @@ - @@ -9,7 +9,7 @@ - + diff --git a/mod/forum/db/upgrade.php b/mod/forum/db/upgrade.php index 94bb992d78c..9fbbdfa85f6 100644 --- a/mod/forum/db/upgrade.php +++ b/mod/forum/db/upgrade.php @@ -41,6 +41,8 @@ */ function xmldb_forum_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -57,5 +59,18 @@ function xmldb_forum_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 forum to (1333). + $table = new xmldb_table('forum'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null, 'type'); + + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Forum savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'forum'); + } + return true; } diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index 017d0516bab..0a7bb5aaa67 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -46,7 +46,7 @@ class mod_forum_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(get_string('forumintro', 'forum')); diff --git a/mod/forum/version.php b/mod/forum/version.php index 05573b638c5..572226a93ea 100644 --- a/mod/forum/version.php +++ b/mod/forum/version.php @@ -24,6 +24,6 @@ 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_forum'; // Full name of the plugin (used for diagnostics) diff --git a/mod/glossary/db/install.xml b/mod/glossary/db/install.xml index 5f86bcf6bb3..5015624c23b 100644 --- a/mod/glossary/db/install.xml +++ b/mod/glossary/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php index bfee9217e1c..0ce46cf4416 100644 --- a/mod/glossary/db/upgrade.php +++ b/mod/glossary/db/upgrade.php @@ -40,6 +40,9 @@ */ function xmldb_glossary_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -55,5 +58,18 @@ function xmldb_glossary_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 glossary to (1333). + $table = new xmldb_table('glossary'); + $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); + + // Glossary savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'glossary'); + } + return true; } diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php index e0db550e5e0..38ab5912a11 100644 --- a/mod/glossary/mod_form.php +++ b/mod/glossary/mod_form.php @@ -22,7 +22,7 @@ class mod_glossary_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(); diff --git a/mod/glossary/version.php b/mod/glossary/version.php index 06e2f1d51db..e9fd68742af 100644 --- a/mod/glossary/version.php +++ b/mod/glossary/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_glossary'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/h5pactivity/db/install.xml b/mod/h5pactivity/db/install.xml index 7f637bf5ad5..353b58cee0b 100644 --- a/mod/h5pactivity/db/install.xml +++ b/mod/h5pactivity/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/h5pactivity/db/upgrade.php b/mod/h5pactivity/db/upgrade.php index 36d0bfc09f0..c92aba1bcfe 100644 --- a/mod/h5pactivity/db/upgrade.php +++ b/mod/h5pactivity/db/upgrade.php @@ -46,6 +46,7 @@ */ function xmldb_h5pactivity_upgrade($oldversion) { global $DB; + $dbman = $DB->get_manager(); // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -76,5 +77,18 @@ function xmldb_h5pactivity_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 h5pactivity to (1333). + $table = new xmldb_table('h5pactivity'); + $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); + + // H5pactivity savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'h5pactivity'); + } + return true; } diff --git a/mod/h5pactivity/mod_form.php b/mod/h5pactivity/mod_form.php index 27a65c297c1..27da30a2f50 100644 --- a/mod/h5pactivity/mod_form.php +++ b/mod/h5pactivity/mod_form.php @@ -59,7 +59,7 @@ class mod_h5pactivity_mod_form extends moodleform_mod { } $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(); diff --git a/mod/h5pactivity/version.php b/mod/h5pactivity/version.php index 82386960451..5f269304cc6 100644 --- a/mod/h5pactivity/version.php +++ b/mod/h5pactivity/version.php @@ -25,5 +25,5 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_h5pactivity'; -$plugin->version = 2025041400; +$plugin->version = 2025041401; $plugin->requires = 2025040800; diff --git a/mod/imscp/db/install.xml b/mod/imscp/db/install.xml index 18337fd58a3..60a82a4f004 100644 --- a/mod/imscp/db/install.xml +++ b/mod/imscp/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/imscp/db/upgrade.php b/mod/imscp/db/upgrade.php index 50fdb840c62..1adbff4cceb 100644 --- a/mod/imscp/db/upgrade.php +++ b/mod/imscp/db/upgrade.php @@ -27,6 +27,9 @@ * @param int $oldversion */ function xmldb_imscp_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -42,5 +45,18 @@ function xmldb_imscp_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 imscp to (1333). + $table = new xmldb_table('imscp'); + $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); + + // Imscp savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'imscp'); + } + return true; } diff --git a/mod/imscp/mod_form.php b/mod/imscp/mod_form.php index a8a0eabb394..ced28368253 100644 --- a/mod/imscp/mod_form.php +++ b/mod/imscp/mod_form.php @@ -53,7 +53,7 @@ class mod_imscp_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(); // IMS-CP file upload. diff --git a/mod/imscp/version.php b/mod/imscp/version.php index 047d6f4af40..ada0c9e96bb 100644 --- a/mod/imscp/version.php +++ b/mod/imscp/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_imscp'; // Full name of the plugin (used for diagnostics). $plugin->cron = 0; 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; 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; diff --git a/mod/lti/db/install.xml b/mod/lti/db/install.xml index 1b9c717a2de..f7545f190cd 100644 --- a/mod/lti/db/install.xml +++ b/mod/lti/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/lti/db/upgrade.php b/mod/lti/db/upgrade.php index 655b4024988..1b957317ef2 100644 --- a/mod/lti/db/upgrade.php +++ b/mod/lti/db/upgrade.php @@ -125,5 +125,18 @@ function xmldb_lti_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 lti to (1333). + $table = new xmldb_table('lti'); + $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); + + // Lti savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'lti'); + } + return true; } diff --git a/mod/lti/mod_form.php b/mod/lti/mod_form.php index d6ac4da0dc2..f3c1a14f21e 100644 --- a/mod/lti/mod_form.php +++ b/mod/lti/mod_form.php @@ -136,7 +136,7 @@ class mod_lti_mod_form extends moodleform_mod { $mform->addElement('text', 'name', get_string('basicltiname', 'lti'), ['size' => '64']); $mform->setType('name', PARAM_TEXT); $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'); // Adding the optional "intro" and "introformat" pair of fields. $this->standard_intro_elements(get_string('basicltiintro', 'lti')); diff --git a/mod/lti/version.php b/mod/lti/version.php index 706fd881c2f..4be200b1400 100644 --- a/mod/lti/version.php +++ b/mod/lti/version.php @@ -48,7 +48,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_lti'; // Full name of the plugin (used for diagnostics). $plugin->cron = 0; diff --git a/mod/page/db/install.xml b/mod/page/db/install.xml index 3d2ff4db374..7d47fea7a16 100644 --- a/mod/page/db/install.xml +++ b/mod/page/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/page/db/upgrade.php b/mod/page/db/upgrade.php index 7e2e03d90c3..ad35425acad 100644 --- a/mod/page/db/upgrade.php +++ b/mod/page/db/upgrade.php @@ -43,6 +43,9 @@ */ function xmldb_page_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_page_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 page to (1333). + $table = new xmldb_table('page'); + $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); + + // Page savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'page'); + } + return true; } diff --git a/mod/page/mod_form.php b/mod/page/mod_form.php index 297f9038950..adc4f0d7b96 100644 --- a/mod/page/mod_form.php +++ b/mod/page/mod_form.php @@ -46,7 +46,7 @@ class mod_page_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(); //------------------------------------------------------- diff --git a/mod/page/version.php b/mod/page/version.php index 9e6a80bccc7..7e92b19c59b 100644 --- a/mod/page/version.php +++ b/mod/page/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_page'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/qbank/db/install.xml b/mod/qbank/db/install.xml index fc6c0775863..22121cc8fdb 100644 --- a/mod/qbank/db/install.xml +++ b/mod/qbank/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/qbank/db/upgrade.php b/mod/qbank/db/upgrade.php index b1d86c4fce5..2d7be720e17 100644 --- a/mod/qbank/db/upgrade.php +++ b/mod/qbank/db/upgrade.php @@ -38,5 +38,18 @@ function xmldb_qbank_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 qbank to (1333). + $table = new xmldb_table('qbank'); + $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); + + // Qbank savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'qbank'); + } + return true; } diff --git a/mod/qbank/version.php b/mod/qbank/version.php index 85a19269d11..98b7591a6d1 100644 --- a/mod/qbank/version.php +++ b/mod/qbank/version.php @@ -26,5 +26,5 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_qbank'; -$plugin->version = 2025041400; +$plugin->version = 2025041401; $plugin->requires = 2025040800; diff --git a/mod/quiz/db/install.xml b/mod/quiz/db/install.xml index 3b6aa39662b..229e381f27f 100644 --- a/mod/quiz/db/install.xml +++ b/mod/quiz/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index afd549e4778..784534bd0b6 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -136,5 +136,18 @@ function xmldb_quiz_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 quiz to (1333). + $table = new xmldb_table('quiz'); + $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); + + // Quiz savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'quiz'); + } + return true; } diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index 1829badd4ba..fb9ecc92016 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -80,7 +80,7 @@ class mod_quiz_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', 'quiz')); diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 5e866c35bf8..c34c6e67c3f 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2025041400; +$plugin->version = 2025041401; $plugin->requires = 2025040800; $plugin->component = 'mod_quiz'; 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; diff --git a/mod/scorm/db/install.xml b/mod/scorm/db/install.xml index 6c0f97918f4..bccdbb1cdce 100644 --- a/mod/scorm/db/install.xml +++ b/mod/scorm/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index 15e46930cdf..0513f25701d 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -196,5 +196,18 @@ function xmldb_scorm_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 scorm to (1333). + $table = new xmldb_table('scorm'); + $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); + + // Scorm savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'scorm'); + } + return true; } diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index 83336afb2df..58b0de782da 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -43,7 +43,7 @@ class mod_scorm_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'); // Summary. $this->standard_intro_elements(); diff --git a/mod/scorm/version.php b/mod/scorm/version.php index 6d88d4deead..983f99d1abb 100644 --- a/mod/scorm/version.php +++ b/mod/scorm/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_scorm'; // Full name of the plugin (used for diagnostics). diff --git a/mod/subsection/db/install.xml b/mod/subsection/db/install.xml index 6d5fcfc7c50..e244a5bd13f 100644 --- a/mod/subsection/db/install.xml +++ b/mod/subsection/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/subsection/db/upgrade.php b/mod/subsection/db/upgrade.php index d94859414fd..7b5f5249d25 100644 --- a/mod/subsection/db/upgrade.php +++ b/mod/subsection/db/upgrade.php @@ -45,5 +45,18 @@ function xmldb_subsection_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 subsection to (1333). + $table = new xmldb_table('subsection'); + $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); + + // Subsection savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'subsection'); + } + return true; } diff --git a/mod/subsection/mod_form.php b/mod/subsection/mod_form.php index 002d56df076..a5ebdd7ea6b 100644 --- a/mod/subsection/mod_form.php +++ b/mod/subsection/mod_form.php @@ -64,7 +64,7 @@ class mod_subsection_mod_form extends moodleform_mod { } $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'); // Add standard elements. $this->standard_coursemodule_elements(); diff --git a/mod/subsection/version.php b/mod/subsection/version.php index 8dd37209b0f..a9e1dc09fdc 100644 --- a/mod/subsection/version.php +++ b/mod/subsection/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'mod_subsection'; -$plugin->version = 2025041400; +$plugin->version = 2025041401; $plugin->requires = 2025040800; $plugin->maturity = MATURITY_STABLE; diff --git a/mod/url/db/install.xml b/mod/url/db/install.xml index 1acb3dda8e4..6bfe28023f3 100644 --- a/mod/url/db/install.xml +++ b/mod/url/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/url/db/upgrade.php b/mod/url/db/upgrade.php index af69660edbc..a4ae7abe54a 100644 --- a/mod/url/db/upgrade.php +++ b/mod/url/db/upgrade.php @@ -43,6 +43,9 @@ */ function xmldb_url_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -68,5 +71,18 @@ function xmldb_url_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 url to (1333). + $table = new xmldb_table('url'); + $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); + + // Url savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'url'); + } + return true; } diff --git a/mod/url/mod_form.php b/mod/url/mod_form.php index 31b2da6f2d5..4193d3aa4a2 100644 --- a/mod/url/mod_form.php +++ b/mod/url/mod_form.php @@ -45,7 +45,7 @@ class mod_url_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'); $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true)); $mform->setType('externalurl', PARAM_RAW_TRIMMED); $mform->addRule('externalurl', null, 'required', null, 'client'); diff --git a/mod/url/version.php b/mod/url/version.php index 35a25377747..215c1d330fe 100644 --- a/mod/url/version.php +++ b/mod/url/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_url'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0; diff --git a/mod/wiki/db/install.xml b/mod/wiki/db/install.xml index d7226d8f59d..c7d09a37fff 100644 --- a/mod/wiki/db/install.xml +++ b/mod/wiki/db/install.xml @@ -1,5 +1,5 @@ - @@ -8,7 +8,7 @@ - + diff --git a/mod/wiki/db/upgrade.php b/mod/wiki/db/upgrade.php index 34724bef8ea..6f9f14de42f 100644 --- a/mod/wiki/db/upgrade.php +++ b/mod/wiki/db/upgrade.php @@ -36,6 +36,9 @@ */ function xmldb_wiki_upgrade($oldversion) { + global $DB; + $dbman = $DB->get_manager(); + // Automatically generated Moodle v4.2.0 release upgrade line. // Put any upgrade step following this. @@ -51,5 +54,18 @@ function xmldb_wiki_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 wiki to (1333). + $table = new xmldb_table('wiki'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, 'Wiki', 'course'); + + // Launch change of precision for field name. + $dbman->change_field_precision($table, $field); + + // Wiki savepoint reached. + upgrade_mod_savepoint(true, 2025041401, 'wiki'); + } + return true; } diff --git a/mod/wiki/mod_form.php b/mod/wiki/mod_form.php index 36423563796..4ca57905886 100644 --- a/mod/wiki/mod_form.php +++ b/mod/wiki/mod_form.php @@ -53,7 +53,7 @@ class mod_wiki_mod_form extends moodleform_mod { $mform->addElement('text', 'name', get_string('wikiname', 'wiki'), array('size' => '64')); $mform->setType('name', PARAM_TEXT); $mform->addRule('name', $required, 'required', null, 'client'); - $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); + $mform->addRule('name', get_string('maximumchars', '', 1333), 'maxlength', 1333, 'client'); // Adding the optional "intro" and "introformat" pair of fields $this->standard_intro_elements(get_string('wikiintro', 'wiki')); diff --git a/mod/wiki/version.php b/mod/wiki/version.php index 8db9ba5d176..704d3ad9e57 100644 --- a/mod/wiki/version.php +++ b/mod/wiki/version.php @@ -33,6 +33,6 @@ 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_wiki'; // Full name of the plugin (used for diagnostics) 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'; diff --git a/question/classes/local/bank/question_bank_helper.php b/question/classes/local/bank/question_bank_helper.php index eb193835c7f..378b84ec0eb 100644 --- a/question/classes/local/bank/question_bank_helper.php +++ b/question/classes/local/bank/question_bank_helper.php @@ -75,7 +75,7 @@ class question_bank_helper { /** * Maximum length for the question bank name database field. */ - public const BANK_NAME_MAX_LENGTH = 255; + public const BANK_NAME_MAX_LENGTH = 1333; /** * Modules that share questions via FEATURE_PUBLISHES_QUESTIONS. diff --git a/question/tests/local/bank/question_bank_helper_test.php b/question/tests/local/bank/question_bank_helper_test.php index 36a4ec9d88c..b58084f610a 100644 --- a/question/tests/local/bank/question_bank_helper_test.php +++ b/question/tests/local/bank/question_bank_helper_test.php @@ -270,7 +270,8 @@ final class question_bank_helper_test extends \advanced_testcase { self::setAdminUser(); $coursename = random_string(question_bank_helper::BANK_NAME_MAX_LENGTH); - $course = self::getDataGenerator()->create_course(['shortname' => $coursename]); + $courseshortname = \core_text::substr($coursename, 0, 255); + $course = self::getDataGenerator()->create_course(['shortname' => $courseshortname]); $this->expectExceptionMessage('The provided bankname is too long for the database field.'); question_bank_helper::create_default_open_instance( @@ -411,7 +412,17 @@ final class question_bank_helper_test extends \advanced_testcase { public static function bank_name_strings(): array { $longname = 'One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen ' . 'eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four twenty-five twenty-six twenty-seven ' . - 'twenty-eight twenty-nine thirty thirty-one'; + 'twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three thirty-four thirty-five thirty-six thirty-seven ' . + 'thirty-eight thirty-nine forty forty-one forty-two forty-three forty-four forty-five forty-six forty-seven ' . + 'forty-eight forty-nine fifty fifty-one fifty-two fifty-three fifty-four fifty-five fifty-six fifty-seven ' . + 'fifty-eight fifty-nine sixty sixty-one sixty-two sixty-three sixty-four sixty-five sixty-six sixty-seven ' . + 'sixty-eight sixty-nine seventy seventy-one seventy-two seventy-three seventy-four seventy-five seventy-six ' . + 'seventy-seven seventy-eight seventy-nine eighty eighty-one eighty-two eighty-three eighty-four eighty-five ' . + 'eighty-six eighty-seven eighty-eight eighty-nine ninety ninety-one ninety-two ninety-three ninety-four ninety-five ' . + 'ninety-six ninety-seven ninety-eight ninety-nine one hundred one hundred one one hundred two one hundred three ' . + 'one hundred four one hundred five one hundred six one hundred seven one hundred eight one hundred nine ' . + 'one hundred ten one hundred eleven one hundred twelve one hundred thirteen one hundred fourteen one hundred fifteen ' . + 'one hundred sixteen one hundred seventeen'; return [ 'String with no parameters' => [ 'systembank', @@ -431,7 +442,17 @@ final class question_bank_helper_test extends \advanced_testcase { $longname, 'Top for One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen ' . 'seventeen eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four twenty-five twenty-six ' . - 'twenty-seven twenty-eight ...', + 'twenty-seven twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three thirty-four thirty-five ' . + 'thirty-six thirty-seven thirty-eight thirty-nine forty forty-one forty-two forty-three forty-four ' . + 'forty-five forty-six forty-seven forty-eight forty-nine fifty fifty-one fifty-two fifty-three fifty-four ' . + 'fifty-five fifty-six fifty-seven fifty-eight fifty-nine sixty sixty-one sixty-two sixty-three sixty-four ' . + 'sixty-five sixty-six sixty-seven sixty-eight sixty-nine seventy seventy-one seventy-two seventy-three ' . + 'seventy-four seventy-five seventy-six seventy-seven seventy-eight seventy-nine eighty eighty-one ' . + 'eighty-two eighty-three eighty-four eighty-five eighty-six eighty-seven eighty-eight eighty-nine ' . + 'ninety ninety-one ninety-two ninety-three ninety-four ninety-five ninety-six ninety-seven ninety-eight ' . + 'ninety-nine one hundred one hundred one one hundred two one hundred three one hundred four ' . + 'one hundred five one hundred six one hundred seven one hundred eight one hundred nine one hundred ten ' . + 'one hundred eleven one hundred twelve one hundred thirteen one hundred fourteen one hundred fifteen one ...', ], 'String with short array parameter' => [ 'defaultbank', @@ -445,23 +466,49 @@ final class question_bank_helper_test extends \advanced_testcase { ['coursename' => $longname], 'One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen ' . 'eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four twenty-five twenty-six ' . - 'twenty-seven twenty-eight ... course question bank', + 'twenty-seven twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three thirty-four thirty-five ' . + 'thirty-six thirty-seven thirty-eight thirty-nine forty forty-one forty-two forty-three forty-four ' . + 'forty-five forty-six forty-seven forty-eight forty-nine fifty fifty-one fifty-two fifty-three fifty-four ' . + 'fifty-five fifty-six fifty-seven fifty-eight fifty-nine sixty sixty-one sixty-two sixty-three sixty-four ' . + 'sixty-five sixty-six sixty-seven sixty-eight sixty-nine seventy seventy-one seventy-two seventy-three ' . + 'seventy-four seventy-five seventy-six seventy-seven seventy-eight seventy-nine eighty eighty-one ' . + 'eighty-two eighty-three eighty-four eighty-five eighty-six eighty-seven eighty-eight eighty-nine ninety ' . + 'ninety-one ninety-two ninety-three ninety-four ninety-five ninety-six ninety-seven ninety-eight ' . + 'ninety-nine one hundred one hundred one one hundred two one hundred three one hundred four ' . + 'one hundred five one hundred six one hundred seven one hundred eight one hundred nine one hundred ten ' . + 'one hundred eleven one hundred twelve one hundred thirteen one hundred fourteen one hundred fifteen ... ' . + 'course question bank', ], 'String with multiple long array parameters' => [ 'markoutofmax', 'question', ['mark' => $longname, 'max' => $longname], 'Mark One two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen seventeen ' . - 'eighteen ... out of One two three four five six seven eight nine ten eleven twelve thirteen fourteen ' . - 'fifteen sixteen seventeen eighteen ...', + 'eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four twenty-five twenty-six twenty-seven ' . + 'twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three thirty-four thirty-five thirty-six ' . + 'thirty-seven thirty-eight thirty-nine forty forty-one forty-two forty-three forty-four forty-five forty-six ' . + 'forty-seven forty-eight forty-nine fifty fifty-one fifty-two fifty-three fifty-four fifty-five fifty-six ' . + 'fifty-seven fifty-eight fifty-nine sixty sixty-one sixty-two sixty-three sixty-four sixty-five sixty-six ' . + 'sixty-seven ... out of One two three four five six seven eight nine ten eleven twelve thirteen fourteen ' . + 'fifteen sixteen seventeen eighteen nineteen twenty twenty-one twenty-two twenty-three twenty-four ' . + 'twenty-five twenty-six twenty-seven twenty-eight twenty-nine thirty thirty-one thirty-two thirty-three ' . + 'thirty-four thirty-five thirty-six thirty-seven thirty-eight thirty-nine forty forty-one forty-two ' . + 'forty-three forty-four forty-five forty-six forty-seven forty-eight forty-nine fifty fifty-one fifty-two ' . + 'fifty-three fifty-four fifty-five fifty-six fifty-seven fifty-eight fifty-nine sixty sixty-one sixty-two ' . + 'sixty-three sixty-four sixty-five sixty-six sixty-seven ...', ], 'Long lang string' => [ 'howquestionsbehave_help', 'question', null, - 'Students can interact with the questions in the quiz in various different ways. For example, you may wish the ' . - 'students to enter an answer to each question and then submit the entire quiz, before anything is graded or ' . - 'they get any feedback. That would ...', + "Students can interact with the questions in the quiz in various different ways. For example, you may wish the " . + "students to enter an answer to each question and then submit the entire quiz, before anything is graded or " . + "they get any feedback. That would be 'Deferred feedback' mode.\n\n" . + "Alternatively, you may wish for students to submit each question as they go along to get immediate " . + "feedback, and if they do not get it right immediately, have another try for fewer marks. That would be " . + "'Interactive with multiple tries' mode.\n" . + "\n" . + "Those are probably the two most commonly used modes of behaviour. ", ], ]; } diff --git a/version.php b/version.php index 8c4d98a0083..955fb8dad86 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2025051600.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2025051600.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '5.1dev (Build: 20250516)'; // Human-friendly version name