MDL-46049 chat: update calendar times on repeating chat sessions
authorDan Poltawski <dan@moodle.com>
Thu, 5 Nov 2015 15:54:17 +0000 (15:54 +0000)
committerDan Poltawski <dan@moodle.com>
Thu, 5 Nov 2015 16:02:08 +0000 (16:02 +0000)
Previously were using the invalid chat id and the calendar entry was not
updated.

Thanks to Andy McGill who worked this out.

mod/chat/lib.php

index 6649eb1..14b8c30 100644 (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;