MDL-46049 chat: update calendar times on repeating chat sessions

Previously were using the invalid chat id and the calendar entry was not
updated.

Thanks to Andy McGill who worked this out.
This commit is contained in:
Dan Poltawski
2015-11-05 16:03:03 +00:00
parent 7ba8e5dbd9
commit bc1d433972
+1 -1
View File
@@ -634,7 +634,7 @@ function chat_update_chat_times($chatid=0) {
$event = new stdClass(); // Update calendar too.
$cond = "modulename='chat' AND instance = :chatid AND timestart <> :chattime";
$params = array('chattime' => $chat->chattime, 'chatid' => $chatid);
$params = array('chattime' => $chat->chattime, 'chatid' => $chat->id);
if ($event->id = $DB->get_field_select('event', 'id', $cond, $params)) {
$event->timestart = $chat->chattime;