From a398df53817fa5929680d2aa2e4db1779a91d762 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Fri, 24 May 2019 11:52:54 +0800 Subject: [PATCH] MDL-65707 calendar: set the correct event type on site calendar --- calendar/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/lib.php b/calendar/lib.php index be383703c3e..07ba6fd871c 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -3502,7 +3502,7 @@ function calendar_output_fragment_event_form($args) { $eventtypes = calendar_get_allowed_event_types($courseid); // If the user is on course context and is allowed to add course events set the event type default to course. - if ($courseid != SITEID && !empty($eventtypes['course'])) { + if (!empty($courseid) && !empty($eventtypes['course'])) { $data['eventtype'] = 'course'; $data['courseid'] = $courseid; $data['groupcourseid'] = $courseid;