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

calendar/view.php lists events out of chronological order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3.1
    • 3.3, 3.4
    • 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

      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.

            cameron1729 cameron1729
            cameron1729 cameron1729
            Marcus Green Marcus Green
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            John Okely John Okely
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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