Skip to content

Commit

Permalink
MDL-58496 mod_chat: Update timesort when updating timestart
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cameorn1730 committed Apr 28, 2017
1 parent bd99cb9 commit ec4b1e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mod/chat/lib.php
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ec4b1e6

Please sign in to comment.