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-17 08:55:34 +08:00
committed by David Monllao
parent 75aa0f73db
commit 9a5f3f7672
+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;