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

Some usages of the date_selector do not use the optional parameter but use another checkbox meaning the calendar image is never disabled by the JS.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.5
    • 2.5
    • Forms Library
    • None
    • MOODLE_25_STABLE
    • MOODLE_25_STABLE
    • MDL-39463_master
    • Hide

      Test 1

      1. Go to Site administration ► Users ► Accounts ► Browse list of users
      2. Click "Show more"
      3. Next to a date field click on Calender icon and ensure it pops up.
      4. Select a date in the calendar and ensure the pop-up closes and the select boxes update to this date.
      5. Choose a new date in the select boxes and then click on the calendar icon and ensure the pop-up shows this date.
      6. Ensure you can filter by these dates and they work as expected.
      7. Disable some of the dates and ensure the select boxes and calendar image become disabled.
      8. Submit the form and ensure these dates are not used in the filter as they have been disabled.

      Test 2

      1. Create a feedback module.
      2. On the settings page alter the 'Open the feedback at' and 'Close the feedback at'.
      3. Next to a date field click on Calender icon and ensure it pops up.
      4. Select a date in the calendar and ensure the pop-up closes and the select boxes update to this date.
      5. Choose a new date in the select boxes and then click on the calendar icon and ensure the pop-up shows this date.
      6. Ensure you can save these dates and they work as expected.
      7. Disable some of the dates and ensure the select boxes and calendar image become disabled.
      8. Submit the form and ensure the disabled dates are saved in the database as 0.

      Test 3

      1. Repeat the steps in MDL-26649 (sorry)
      Show
      Test 1 Go to Site administration ► Users ► Accounts ► Browse list of users Click "Show more" Next to a date field click on Calender icon and ensure it pops up. Select a date in the calendar and ensure the pop-up closes and the select boxes update to this date. Choose a new date in the select boxes and then click on the calendar icon and ensure the pop-up shows this date. Ensure you can filter by these dates and they work as expected. Disable some of the dates and ensure the select boxes and calendar image become disabled. Submit the form and ensure these dates are not used in the filter as they have been disabled. Test 2 Create a feedback module. On the settings page alter the 'Open the feedback at' and 'Close the feedback at'. Next to a date field click on Calender icon and ensure it pops up. Select a date in the calendar and ensure the pop-up closes and the select boxes update to this date. Choose a new date in the select boxes and then click on the calendar icon and ensure the pop-up shows this date. Ensure you can save these dates and they work as expected. Disable some of the dates and ensure the select boxes and calendar image become disabled. Submit the form and ensure the disabled dates are saved in the database as 0. Test 3 Repeat the steps in MDL-26649 (sorry)

      In 2.x when date_selectors are added to a form group their own disabledIf (the 'optional' parameter) logic does not work, meaning when the element was added to a group developers created their own disabledIf logic.

      The date_selector and date_time_selector elements come with the ability to pass an 'optional' parameter. If this parameter is set to true, then an enabled checkbox is displayed next to the date selects. 2.5 introduced a calendar image next to the date that would trigger the calendar pop-up. When the enable checkbox was present this image would be disabled (ie. you could not click on it for the pop-up to display) if the box was not checked. However, some forms have created their own checkbox to disable the time as the 'optional' parameter disable functionality was not working when the date element was added to a group, which means the JS event to disable calendar image never gets executed as it is only triggered when the checkbox that comes with the element is checked.

            markn Mark Nelson
            markn Mark Nelson
            Jérôme Mouneyrac Jérôme Mouneyrac
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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