diff --git a/calendar/event.php b/calendar/event.php index 735ab5fa53e..d0075d26080 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -424,12 +424,12 @@ if($eventtype == 'select') { $defaultcourse = $SESSION->cal_course_referer; if(isteacheredit($defaultcourse, $USER->id)) { - $defaultgroup = 0; + $defaultgroup = $groupid = 0; } else { $defaultgroup = user_group($defaultcourse, $USER->id); + $groupid = optional_param('groupid', $defaultgroup->id, PARAM_INT); } - $groupid = optional_param('groupid', $defaultgroup->id, PARAM_INT); $courseid = optional_param('courseid', $defaultcourse, PARAM_INT); echo '