Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52337

JS calendar is very innefficient when date selector form element is included multiple times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 3.0
    • Calendar, Forms Library
    • MOODLE_30_STABLE
    • MDL-52337-master
    • Hide

      Requires developer changes

      Find a form that adds a date_time_selector...

      $mform->addElement('date_time_selector', 'elementID', 'string');
      

      ...and add a forth argument...

      array('hideyuicalendar' => true)
      

      ...so that it becomes...

      $mform->addElement('date_time_selector', 'elementID', 'string', array('hideyuicalendar' => true));
      

      Repeat this change with a date_selector form element.

      1. Test the form and see if the JS icon/pop-up is loaded (should be hidden).
      2. Negate the value of 'hideyuicalendar' and test again (should be shown).
      Show
      Requires developer changes Find a form that adds a date_time_selector... $mform->addElement('date_time_selector', 'elementID', 'string'); ...and add a forth argument... array('hideyuicalendar' => true) ...so that it becomes... $mform->addElement('date_time_selector', 'elementID', 'string', array('hideyuicalendar' => true)); Repeat this change with a date_selector form element. Test the form and see if the JS icon/pop-up is loaded (should be hidden). Negate the value of 'hideyuicalendar' and test again (should be shown).

      I had a report of problem loading the instance configuration page for the Progress Bar block when there are a high number of activities in a course (CONTRIB-5958).

      The configuration page includes a few form elements for each activity in the course and there are dependencies between the elements. When there are several hundred activities, the page generation can take up to minute and rendering the page can take several minutes, that's if the page loads at all.

      I was able to narrow the efficiency problem to the date selector form elements. The culprit seems to be the JS (YUI2) pop-up calendar that is accessed from the date selector icon. When this icon/pop-up is removed, the block instance configuration page for a course with ~500 activities loads in a reasonable amount of time.

      The ideal solution would be to track down the inneffiency within the JS and make this better, but I would settle for an option on the date selector that allows control over whether this icon/pop-up is displayed.

            Unassigned Unassigned
            salvetore Michael de Raadt
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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