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

Date form elements should add the javascript when rendered and not in the constructor

    XMLWordPrintable

Details

    • MOODLE_37_STABLE
    • MOODLE_38_STABLE
    • MDL-66020-master
    • Hide
      1. Open any form with datetimeselector (for example, course edit form)
      2. Make sure that date picker icon works - it brings the calendar popup and you can pick the date
      3. Open any form with dateselector (for example, gradebook inside the course and "Grade history" report)
      4. Make sure that date picker icon works - it brings the calendar popup and you can pick the date
      5. Repeat test in both boost and classic themes
      Show
      Open any form with datetimeselector (for example, course edit form) Make sure that date picker icon works - it brings the calendar popup and you can pick the date Open any form with dateselector (for example, gradebook inside the course and "Grade history" report) Make sure that date picker icon works - it brings the calendar popup and you can pick the date Repeat test in both boost and classic themes

    Description

      Form elements date_selector and datetime_selector initialize javascript in the constructor instead of when they are rendered.
      This breaks the following scenarios for modal forms:

      • Initialise an instance of the form
      • Check if form was submitted,
      • if yes
        • do something, redirect, return true.... whatever needs to be done. Except that form does not need to be rendered after it was submitted
      • if not
        • start collecting javascript requirements
        • render form, capture output
        • return html and js

      As a result the JS does not contain the js needed for the calendar icon in date selector.

      Attachments

        Activity

          People

            marina Marina Glancy
            marina Marina Glancy
            Paul Holden Paul Holden
            Jake Dallimore Jake Dallimore
            Gladys Basiana Gladys Basiana
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              18/Nov/19

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 45 minutes
                3h 45m