MDL-65707 calendar: set the correct event type on site calendar

This commit is contained in:
Simey Lameze
2019-06-25 10:23:34 +08:00
parent 30d4327769
commit a398df5381
+1 -1
View File
@@ -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;