From c879145e4276abdbf74c7c467dd08436dbcebf16 Mon Sep 17 00:00:00 2001 From: Stephen Bourget Date: Sat, 19 Nov 2016 16:18:24 -0500 Subject: [PATCH] MDL-55568 chat: chat_refresh_events should only create published events --- mod/chat/lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/chat/lib.php b/mod/chat/lib.php index dd7726f7369..cedafaa93c6 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -448,7 +448,8 @@ function chat_refresh_events($courseid = 0) { if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'chat', 'instance' => $chat->id))) { $calendarevent = calendar_event::load($event->id); $calendarevent->update($event); - } else { + } else if ($chat->schedule > 0) { + // The chat is scheduled and the event should be published. $event->courseid = $chat->course; $event->groupid = 0; $event->userid = 0;