Moodle
  1. Moodle
  2. MDL-11872

Course Category name length too short in multilang environement

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Component/s: Course
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE
    • Rank:
      6970

      Description

      The space allowed is not enough if your moodle site is designed for several languages.

      The category name field is only size="30"
      <input type="text" size="30" alt="Add new category" name="addcategory" />

      In the table mdl_course_categories, the filed name is only varchar(255). (MYSQL db)

      I've fixed on my own installation with direct editing and modifing the db field type to varchar (350) Enough for 5 languages.

      <span lang="en" class="multilang">Language Courses</span><span lang="it" class="multilang">Corsi di lingua</span><span lang="fr" class="multilang">Cours de langue</span><span lang="es" class="multilang">Cursos de idiomas</span><span lang="de" class="multilang">Sprachkurse</span>

        Activity

        Hide
        Olli Salo added a comment -

        I run across this problem, too, and it's really annoying. The reason for this is the fact that the old multilang works, as it is shorter. Now, as the new class="multilang" takes much more space, some unlucky Moodler might start using the new multilang syntax without realizing what the consequences can be if a moodle admin did the change from old to new multilang syntax automatically.

        I tried to make a search&replace to my whole Moodle database via admin/replace.php and changed the syntax by adding the class="multilang" to my whole database (test database, not production of course). I got a huge list of successful replacements but here and there I saw errors stating that the admin/replace.php didn't work due to too long string: all I got was errors like this:

        "-1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php"

        Needless to say, I had to stay with the old syntax. So I too would like to see this problem fixed because otherwise people are forced to stay in the old, non-supported syntax.

        Show
        Olli Salo added a comment - I run across this problem, too, and it's really annoying. The reason for this is the fact that the old multilang works, as it is shorter. Now, as the new class="multilang" takes much more space, some unlucky Moodler might start using the new multilang syntax without realizing what the consequences can be if a moodle admin did the change from old to new multilang syntax automatically. I tried to make a search&replace to my whole Moodle database via admin/replace.php and changed the syntax by adding the class="multilang" to my whole database (test database, not production of course). I got a huge list of successful replacements but here and there I saw errors stating that the admin/replace.php didn't work due to too long string: all I got was errors like this: "-1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php" Needless to say, I had to stay with the old syntax. So I too would like to see this problem fixed because otherwise people are forced to stay in the old, non-supported syntax.
        Hide
        Olli Salo added a comment -

        Here's a list of some of the problematic fields. I would second the idea of extending the length of these fields quite a lot as otherwise the multilang just doesn't work properly.

        *********************

        -1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php
        ADOConnection.Execute(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php
        execute_sql(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php
        db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php

        Virhe

        *********************

        -1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php
        ADOConnection.Execute(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php
        execute_sql(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php
        db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php

        ***********************

        -1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php
        ADOConnection.Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php
        execute_sql(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php
        db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php

        *********************

        -1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php
        ADOConnection.Execute(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php
        execute_sql(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php
        db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php

        *********************

        -1: ERROR: value too long for type character varying(255)

        ADOConnection._Execute(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php
        ADOConnection.Execute(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php
        execute_sql(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php
        db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php

        ***********************

        Show
        Olli Salo added a comment - Here's a list of some of the problematic fields. I would second the idea of extending the length of these fields quite a lot as otherwise the multilang just doesn't work properly. ********************* -1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php ADOConnection.Execute(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php execute_sql(UPDATE mdl_grade_letters SET letter = REPLACE(letter, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php Virhe ********************* -1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php ADOConnection.Execute(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php execute_sql(UPDATE mdl_lesson SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php *********************** -1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php ADOConnection.Execute(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php execute_sql(UPDATE mdl_lesson_pages SET title = REPLACE(title, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php ********************* -1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php ADOConnection.Execute(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php execute_sql(UPDATE mdl_question_categories SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php ********************* -1: ERROR: value too long for type character varying(255) ADOConnection._Execute(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"'), false) % line 891, file: adodb.inc.php ADOConnection.Execute(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 89, file: dmllib.php execute_sql(UPDATE mdl_resource SET name = REPLACE(name, 'span lang=\"en\"', 'span lang=\"en\" class=\"multilang\"')) % line 4842, file: adminlib.php db_replace(span lang=\"en\", span lang=\"en\" class=\"multilang\") % line 37, file: replace.php ***********************
        Hide
        Olli Salo added a comment -

        Btw this affects 1.9.5 too, not just the old 1.8 Moodle.

        Show
        Olli Salo added a comment - Btw this affects 1.9.5 too, not just the old 1.8 Moodle.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d;

        4d6f6f646c6521

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.3 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; 4d6f6f646c6521
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        If you still believe this is an issue in supported versions, please report a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you still believe this is an issue in supported versions, please report a new issue.

          People

          • Votes:
            6 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: