MDL-55568 chat: chat_refresh_events should only create published events

This commit is contained in:
Stephen Bourget
2016-12-13 18:54:48 -05:00
parent 45fe30fc2d
commit c879145e42
+2 -1
View File
@@ -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;