From ec4b1e6183a1ccb42b5f18f7fb6be21a1c6cddd6 Mon Sep 17 00:00:00 2001 From: Cameron Ball Date: Fri, 28 Apr 2017 12:06:25 +0800 Subject: [PATCH] MDL-58496 mod_chat: Update timesort when updating timestart Previously when a repeating chat was updating the calendar it would only update the timestart column. It needs to also update the timesort column to display correctly on the new overview. --- mod/chat/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/chat/lib.php b/mod/chat/lib.php index bc4d8639335..7d28da9fb99 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -454,6 +454,7 @@ function chat_refresh_events($courseid = 0) { $event->type = CALENDAR_EVENT_TYPE_ACTION; $event->description = format_module_intro('chat', $chat, $cm->id); $event->timestart = $chat->chattime; + $event->timesort = $chat->chattime; if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id))) { $calendarevent = calendar_event::load($event->id); @@ -674,7 +675,8 @@ function chat_update_chat_times($chatid=0) { $params = array('chattime' => $chat->chattime, 'chatid' => $chat->id); if ($event->id = $DB->get_field_select('event', 'id', $cond, $params)) { - $event->timestart = $chat->chattime; + $event->timestart = $chat->chattime; + $event->timesort = $chat->chattime; $calendarevent = calendar_event::load($event->id); $calendarevent->update($event, false); }