if($eventtype == 'select') {
$courseid = optional_param('courseid', $SESSION->cal_course_referer, PARAM_INT);
+ if ($courseid == 0) { // workaround by Dan for bug #6130
+ $courseid = SITEID;
+ }
if (!$course = get_record('course', 'id', $courseid)) {
error('Incorrect course ID');
}
<?php print_string('eventdate', 'calendar'); ?>:
</td>
<td>
- <?php print_date_selector('startday', 'startmon', 'startyr', $form->timestart);?>
+ <?php print_date_selector('startday', 'startmon', 'startyr', (int)$form->timestart);?>
<?php print_string('eventtime', 'calendar');?>
- <?php print_time_selector('starthr', 'startmin', $form->timestart) ?>
+ <?php print_time_selector('starthr', 'startmin', (int)$form->timestart) ?>
<?php if (isset($err['timestart'])) formerr($err['timestart']); ?>
</td>
</tr>