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

staffrolename field length is too short in scheduler table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.7
    • 2.5.6, 2.6.3, 2.7
    • Module: Scheduler
    • None
    • 2014052800
    • MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_27_STABLE

      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

            bostelm Henning Bostelmann
            michael-milette Michael Milette
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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