From 070fac98ea13d2e7d2f16d66c357cc782cc9830c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Fri, 24 Jan 2025 16:12:58 +0100 Subject: [PATCH] MDL-83985 mod_scorm: change name to 1333 chars --- mod/scorm/db/install.xml | 4 ++-- mod/scorm/db/upgrade.php | 13 +++++++++++++ mod/scorm/mod_form.php | 2 +- mod/scorm/version.php | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) 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).