Moodle
  1. Moodle
  2. MDL-10026

mdl_course shortname has incorrect length

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.5, 1.7.2, 1.8
    • Fix Version/s: 1.9
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Environment:
      Any
    • Database:
      Any
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      29435

      Description

      Both the old mysql.sql files (for 1.7.x and below) and the new install.xml (for 1.7.x and above) file specify an incorrect lenght for the 'shortname' field. The current lenght is 100 characteres (as has always been for MySQL) but Postgres has always had 15 characters, and this is the limit imposed by the code in several places, and is also the value for the 'shortname' field in prefix_course_request.

      I know this is not a severe bug, but making the whole thing homogen would certainly help when dealing with the code There is no way this could break existing installations, except for those creating course by directly inserting valures in prefix_course, as Moodle doesn't allow you to use more than 15 characters for the shortname if using the web interface.

      Saludos. Iñaki.

        Activity

        Hide
        Josh Benner added a comment -

        Is there any indication as to which way the final limit will go? We make use of the shortname field for automatic enrollment, and definitely need more than 15 characters. We've made small modifications to Moodle to allow the use of the full 100 chars, and we would like to see Moodle properly support use of 100 chars for shortname officially.

        Show
        Josh Benner added a comment - Is there any indication as to which way the final limit will go? We make use of the shortname field for automatic enrollment, and definitely need more than 15 characters. We've made small modifications to Moodle to allow the use of the full 100 chars, and we would like to see Moodle properly support use of 100 chars for shortname officially.
        Hide
        Martin Dougiamas added a comment -

        100 chars is fine by me

        Show
        Martin Dougiamas added a comment - 100 chars is fine by me
        Hide
        Eloy Lafuente (stronk7) added a comment - - edited

        Oki,

        I'll implement a upgrade to 100cc (to fix old servers with smaller sizes). Also, I'll search and destroy all places where the hard limit to 15 is being applied.

        So, from 1.9, it will be, officially, 100cc. Just waiting for confirmation if it must be backported to other branches (-1 for that).

        Show
        Eloy Lafuente (stronk7) added a comment - - edited Oki, I'll implement a upgrade to 100cc (to fix old servers with smaller sizes). Also, I'll search and destroy all places where the hard limit to 15 is being applied. So, from 1.9, it will be, officially, 100cc. Just waiting for confirmation if it must be backported to other branches (-1 for that).
        Hide
        Martin Dougiamas added a comment -

        1.9 only I think

        Show
        Martin Dougiamas added a comment - 1.9 only I think
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Done, I've searched across code and only found two places where it was limited to 15:

        backup/restorelib.php and enrol/database/enrol.php

        Now both them allow 100cc.

        Fixed...thanks for the report!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Done, I've searched across code and only found two places where it was limited to 15: backup/restorelib.php and enrol/database/enrol.php Now both them allow 100cc. Fixed...thanks for the report! Ciao
        Hide
        Nicolas Martignoni added a comment -

        Verified on 1.9 from CVS, closing.

        Show
        Nicolas Martignoni added a comment - Verified on 1.9 from CVS, closing.
        Hide
        Josh Benner added a comment -

        Did you address the field limitation of 15 characters in the HTML output?

        1. course/edit_form.php
        2. moodle/course/request_form.php
        3. moodle/backup/restore_form.html
        Show
        Josh Benner added a comment - Did you address the field limitation of 15 characters in the HTML output? course/edit_form.php moodle/course/request_form.php moodle/backup/restore_form.html
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Josh,

        both course/edit_form.php and course/resquest_form.php were okey (they allowed up to 100cc before).

        and backup/restore_form.html, I missed it in my search of candidates to fix. Thanks! Should be fixed now in CVS.

        Ciao

        P.S.: Perhaps the size (display) of the field could be slightly increased too... 20cc, for example?

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Josh, both course/edit_form.php and course/resquest_form.php were okey (they allowed up to 100cc before). and backup/restore_form.html, I missed it in my search of candidates to fix. Thanks! Should be fixed now in CVS. Ciao P.S.: Perhaps the size (display) of the field could be slightly increased too... 20cc, for example?
        Hide
        Josh Benner added a comment -

        In our install, we set it to 50 (the same as the long name) – it seemed to look the best, though it does not convey the idea that one is ideally shorter than the other. We did it mostly because our short names are in the format of Year-Term-Session-CourseCode-CourseType-CourseSubType-Section.

        20 or 30 characters would be good for shortname, I think. Current visual field size is definitely too small though.

        Show
        Josh Benner added a comment - In our install, we set it to 50 (the same as the long name) – it seemed to look the best, though it does not convey the idea that one is ideally shorter than the other. We did it mostly because our short names are in the format of Year-Term-Session-CourseCode-CourseType-CourseSubType-Section. 20 or 30 characters would be good for shortname, I think. Current visual field size is definitely too small though.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Oki, moving the three occurrences:

        course/edit_form.php
        course/resquest_form.php
        backup/restore_form.html

        up to 20. I really think it must remain visually smaller than the fullname. Agree.

        Thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Oki, moving the three occurrences: course/edit_form.php course/resquest_form.php backup/restore_form.html up to 20. I really think it must remain visually smaller than the fullname. Agree. Thanks!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        ... and done!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - ... and done! Ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: