Skip to content

Commit

Permalink
MDL-58994 core_calendar: Coalesce event sort field
Browse files Browse the repository at this point in the history
There are situations where we need to sort events on a field called
"timesort", but sometimes it is not set. So we can fall back to
"timestart" in this case.
  • Loading branch information
cameorn1730 committed May 19, 2017
1 parent 17fb1d8 commit 919b5c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion calendar/classes/local/event/data_access/event_vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function get_events(
$coursesfilter,
$where,
$params,
"e.timesort ASC, e.id ASC",
"COALESCE(e.timesort, e.timestart) ASC, e.id ASC",
$offset,
$limitnum,
$ignorehidden
Expand Down

0 comments on commit 919b5c9

Please sign in to comment.