Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70556

Increase course fullname database field length beyond 254 characters

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_404_STABLE
    • MOODLE_500_STABLE
    • Hide

      Course settings

      1. As admin, create a course and give it a title that exceeds 254 characters but not exceeds 1333 characters, and a shortname of more than 100 characters, and less than 255 and save.
      2. Verify the course saves properly.

      Course request

      1. Edit the Authenticated user role to give the moodle/course:request capability.
      2. Log in as a teacher, and request a course with a title that exceeds 254 characters but not exceeds 1333 characters, and a shortname of more than 100 characters, and less than 255 and save.
      3. Verify the request saves properly.
      4. As admin, approve the course request.
      5. Verify the course is created with the correct name.
      Show
      Course settings As admin, create a course and give it a title that exceeds 254 characters but not exceeds 1333 characters, and a shortname of more than 100 characters, and less than 255 and save. Verify the course saves properly. Course request Edit the Authenticated user role to give the moodle/course:request capability. Log in as a teacher, and request a course with a title that exceeds 254 characters but not exceeds 1333 characters, and a shortname of more than 100 characters, and less than 255 and save. Verify the request saves properly. As admin, approve the course request. Verify the course is created with the correct name.
    • Hide

      Code verified against automated checks.

      Checked MDL-70556 using repository: https://github.com/timhunt/moodle.git

      More information about this report

      Built on: Fri 15 Nov 2024 04:46:21 PM UTC

      Show
      Code verified against automated checks. Checked MDL-70556 using repository: https://github.com/timhunt/moodle.git main (0 errors / 0 warnings) [branch: MDL-70556 | CI Job ] More information about this report Built on: Fri 15 Nov 2024 04:46:21 PM UTC
    • Show
      Launching automatic jobs for branch MDL-70556 https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17371/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59281/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59282/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59283/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/59284/ App tests (stable app version) Built on: Fri Nov 15 16:25:44 UTC 2024

      Issue Description

      When creating multi-language Moodle sites with more than just a few languages, the current 254/255 character limit is not enough. This is barely enough for sites with 2 languages where you are left with about 82 characters per language after you included the 2 sets of opening and closing HTML SPAN multilang tag wrappers at 42-45 characters each.

      What is needed is to remove or significantly expand the current character limit for fields with a 254/255 character limit in order to be able to support more languages in a course name.

      Why this is needed

      Let's say I want to create Moodle site where individual course are available in 3 languages. This is often desirable over having multiple single language courses because it allows you to switch language at any point during the course.

      That would limit you to 84 characters per language. However, after factoring in the SPAN multilang tags (about 45 characters per language), you are actually left with an average of just 39 characters for the course fullname and shortname which is pretty tight.

      To support 4 languages is not reasonable leaving you with just 18-20 characters per language for course names. 5 languages and up is not feasible (5 characters or less per course name).

      Other fields in Moodle are also too short

      This field size limitation does not only affect course fullname and shortname fields. There are other fields in blocks, activities, etc. which could also benefit from overcoming the 254 character limitation. However, I propose that these be identified and dealt with individually in order to keep development and testing manageable.

      Unfortunately it is not likely to be enough to just modify the course edit form and expand the size of the field in the database. The scope of such modifications are likely to also impact course backup/restore, course request, mnet and more.

      Moodle v4.0 might be a good time to improve Moodle support for multi-languages.

      Workaround

      It is possible to squeeze an extra language in using the 3rd party Multi-Language Content (v2) filter instead of the Multi-Language Content filter which comes bundled with Moodle. Its {mlang} tags require a little less than half the space of the SPAN tags but that still won't be enough if you are trying to get 9 languages going on your site.

      Alternatively, at least in the case of a course full name, you could use a custom course field and refer to it filters like FilterCodes.

      Discussions

      You can find some past discussion surrounding this issue in the following forum thread:

            timhunt Tim Hunt
            michael-milette Michael Milette
            Luca Bösch Luca Bösch
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            26 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 13 minutes
                4h 13m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.