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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: Calendar, Forms Library
    • Labels:
    • Testing Instructions:
      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).
    • Affected Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-52337-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              salvetore Michael de Raadt
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: