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

    • 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

      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.

        1. Confirmed and verified.png
          132 kB
          Gladys Basiana
        2. MDL-66020.png
          10 kB
          Paul Holden

            marina Marina Glancy
            marina Marina Glancy
            Paul Holden Paul Holden
            Jake Dallimore Jake Dallimore
            Gladys Basiana Gladys Basiana
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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