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

calendar/view.php lists events out of chronological order

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3, 3.4
    • Fix Version/s: 3.3.1
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      1. Navigate to "Site administration" > "Appearance" > "Calendar"
      2. Change the setting "Days to look ahead" to "1 year" and save changes
      3. Navigate to the calendar
      4. Create a new event like so:
        • Type of event: Site
        • Event title: Event 1
        • Date: Some time in the future, let's say June 19 2017
      5. Create another event:
        • Type of event: Site
        • Event title: Event 2
        • Date: Some time after Event 1, let's say June 20 2017
      6. Create another event:
        • Type of event: Site
        • Event title: Event 3
        • Date: Some time in the future, but before Event 1 and 2, let's say May 19 2017
      7. Visit the page /calendar/view.php but make sure there's no extra stuff on the end of it
      8. Verify the events are listed in chronological order (i.e., Event 3, Event 1, Event 2)
      Show
      Navigate to "Site administration" > "Appearance" > "Calendar" Change the setting "Days to look ahead" to "1 year" and save changes Navigate to the calendar Create a new event like so: Type of event: Site Event title: Event 1 Date: Some time in the future, let's say June 19 2017 Create another event: Type of event: Site Event title: Event 2 Date: Some time after Event 1, let's say June 20 2017 Create another event: Type of event: Site Event title: Event 3 Date: Some time in the future, but before Event 1 and 2, let's say May 19 2017 Visit the page /calendar/view.php but make sure there's no extra stuff on the end of it Verify the events are listed in chronological order (i.e., Event 3, Event 1, Event 2)
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-58994-master
    • Sprint:
      3.4 on-sync

      Description

      The get_events method in the event vault orders events by timesort and id. Not all events have timesort set (site and user events, for example) so in these cases the events end up sorted by ID.

      calendar_get_legacy_events is intended to be a drop in replacement for calendar_get_events but also take in to consideration action events, so it uses all the new plumbing but maps the returned events back to the old "stdClass-ish" ones.

      The problem is that the original calendar_get_events sorted events on timestart - so everything always sorted properly, but now it ends up on ID since {{timesort} is null.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Jul/17