MDL-62813 calendar: fix dmlreadexception on event form
This commit is contained in:
@@ -119,10 +119,9 @@ class create extends \moodleform {
|
||||
global $DB, $CFG;
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
$coursekey = isset($data['groupcourseid']) ? 'groupcourseid' : 'courseid';
|
||||
$eventtypes = calendar_get_all_allowed_types();
|
||||
$eventtype = isset($data['eventtype']) ? $data['eventtype'] : null;
|
||||
|
||||
$coursekey = ($eventtype == 'group') ? 'groupcourseid' : 'courseid';
|
||||
if (empty($eventtype) || !isset($eventtypes[$eventtype])) {
|
||||
$errors['eventtype'] = get_string('invalideventtype', 'calendar');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user