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

calendar/view.php lists events out of chronological order

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3, 3.4
    • 3.3.1
    • Calendar
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE
    • MDL-58994-master
    • 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)
    • 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

        Issue Links

          Activity

            People

              cameron1729 cameron1729
              cameron1729 cameron1729
              Marcus Green Marcus Green
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              John Okely John Okely
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Jul/17