Moodle
  1. Moodle
  2. MDL-36075

Date selector in forms errors in IE7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.3
    • Component/s: Forms Library
    • Labels:
      None
    • Testing Instructions:
      Hide

      To test you need either a PC running Internet Explorer 7 or software such as IETester. JavaScript debugging should be enabled in Internet Explorer advanced settings (so you are notified of JavaScript errors).

      Moodle requirements:

      1. Moodle instance on version 2.3+
      2. Manager/editing teacher login
      3. At least 1 course, where user has capability to edit course settings

      The error relates to any Moodle form using formslib that has a date selector in it. This can be tested using the following steps:

      1. Login to a moodle instance
      2. Access the test course e.g. http://qa.moodle.net/course/view.php?id=3
      3. Select 'Edit settings' from the Settings block
      4. You should see no JavaScript errors relating to M.form.dateselector
      5. The course start date field should work as expected (Dynamic calendar appears on selection)
      Show
      To test you need either a PC running Internet Explorer 7 or software such as IETester. JavaScript debugging should be enabled in Internet Explorer advanced settings (so you are notified of JavaScript errors). Moodle requirements: Moodle instance on version 2.3+ Manager/editing teacher login At least 1 course, where user has capability to edit course settings The error relates to any Moodle form using formslib that has a date selector in it. This can be tested using the following steps: Login to a moodle instance Access the test course e.g. http://qa.moodle.net/course/view.php?id=3 Select 'Edit settings' from the Settings block You should see no JavaScript errors relating to M.form.dateselector The course start date field should work as expected (Dynamic calendar appears on selection)
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-36075_MASTER
    • Rank:
      44838

      Description

      When viewing any page with a form with a date selector element in IE7 (I know it's not supported now - but some end users still have it!) you see a JavaScript error relating to dateselector and the date selector JavaScript UI (popup calendar) does not work.

      JS error:
      M.form.dateselector is null or not an object

      Sometimes this error affects other JavaScript on the page and will stop other form elements such as the text editor initialising.

      On investigation I can see the error occurs because there is a trailing comma on line 223 lib/form/yui/dateselector/dateselector.js that was added for MDL-31622.
      IE7 does not like having a trailing comma in objects and doesn't run the script in the file - removing it stops the error and makes the date selector elements in the form work as expected.

        Activity

        Hide
        Jason Platts added a comment -

        Have added github repository info for suggested fix.

        Show
        Jason Platts added a comment - Have added github repository info for suggested fix.
        Hide
        Dan Poltawski added a comment -

        Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..

        Show
        Dan Poltawski added a comment - Sending all 'waiting for peer review' issues to integration before freeze, as agreed in Integrators Meeting 19/10/12. We are doing this to ensure any 'integratable issues' will not got missed before freeze..
        Hide
        Dan Poltawski added a comment -

        Thanks Jason for this.

        Are you able to fill out the testing instructions so we can test for regressions on this?

        Show
        Dan Poltawski added a comment - Thanks Jason for this. Are you able to fill out the testing instructions so we can test for regressions on this?
        Hide
        Michael de Raadt added a comment -

        Test result: Success!

        I tested this in 2.3 and master using IE7.

        I did encounter some JS errors, but they were not related to the date selector and they didn't prevent me from doing anything.

        Show
        Michael de Raadt added a comment - Test result: Success! I tested this in 2.3 and master using IE7. I did encounter some JS errors, but they were not related to the date selector and they didn't prevent me from doing anything.
        Hide
        Dan Poltawski added a comment -

        Hurray!

        You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

        Show
        Dan Poltawski added a comment - Hurray! You did it, congratulations! You have on Mojito credit to redeem after the release of Moodle 2.4

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: