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

    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:
      MDL-66020-master

      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

            • Assignee:
              marina Marina Glancy
              Reporter:
              marina Marina Glancy
              Peer reviewer:
              Paul Holden
              Integrator:
              Jake Dallimore
              Tester:
              Gladys Basiana
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                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