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

Date form elements add javascript in the constructor instead of when rendered

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_37_STABLE

      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:
              Unassigned
              Reporter:
              marina Marina Glancy
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta, Ryan Wyllie, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: