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

Appointment Location field length is too short in scheduler_slots table


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

      The appointmentlocation field in the scheduler_slots table is too short.

      The reason this is an issue for me is because I need to be able to specify the appointment location in multiple languages in this field and the 50 characters defined in the scheduler_slots table schema for this purpose doesn't allow me to do that. Even if I didn't need multiple languages, I also need to specify address, city and province in this field as courses are offered across the country.

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

      {mlang en}123 Mountain street, Montreal, Quebec{mlang}{mlang fr}123 rue de la Montagne, Montréal, Québec{mlang}

      This example requires 112 characters. When I enter this string and click either of the Save buttons, I get a non-descriptive "error" for this field.

      Fixing the issue will require the following 3 changes:

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

      CHANGE #2 - To enable more than 50 characters to be entered in the field, please modify the function add_base_fields() in /mod/scheduler/slotforms.php:

      Is currently:

      $mform->addRule('appointmentlocation', get_string('error'), 'maxlength', 50);

      Should be:

      $mform->addRule('appointmentlocation', get_string('error'), 'maxlength', 255);

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

      Is currently:

      $vars ['LOCATION'] = $slot->appointmentlocation;

      Should be:

      $vars ['LOCATION'] = format_string($slot->appointmentlocation);

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

      Best regards,

      Michael Milette

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


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