Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5155

staffrolename field length is too short in scheduler table

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.6, 2.6.3, 2.7
    • Fix Version/s: 2.7
    • Component/s: Module: Scheduler
    • Labels:
      None
    • Plugin Version:
      2014052800
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE

      Description

      The staffrolename field in the scheduler table is too short. According to Moodle's role_names table, a role name field should be defined as VARCHAR(255).

      The reason this is an issue for me is because I need to be able to specify the role name in multiple languages in this field and the 40 characters defined in the scheduler table schema for this purpose doesn't allow me to do that.

      For example, I use the Moodle multi-lingual content filter. In the "Role name of the teacher" field, I would enter the following string:

      {mlang en}Teacher{mlang}{mlang fr}Enseignant{mlang}
      

      This example requires 52 characters. When I enter this string and click either of the Save buttons, I get the following error message:

      "Data too long for column "staffrolename" at row 1"

      Fixing the issue will require the following 2 changes:

      CHANGE #1 - Please expand the size of the staffrolename field in the scheduler database table to 255 characters.

      CHANGE #2 - To enable multilingual filtering of text entered in the field, please modify the function scheduler_get_teacher_name() in /mod/scheduler/locallib.php:

      Is currently:

      $name = $scheduler->staffrolename;
      

      Should be:

      $name = format_string($scheduler->staffrolename);
      

      Please let me know if you have any questions or concerns regarding these changes.

      Best regards,

      Michael Milette

      Please expand the size of this field.

      Best regards,

      Michael Milette

        Attachments

          Activity

            People

            Assignee:
            bostelm Henning Bostelmann
            Reporter:
            michael-milette Michael Milette
            Participants:
            Component watchers:
            Valery Fremaux
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/May/14