Skip to content

Commit

Permalink
Merge branch 'MDL-74436' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed May 2, 2022
2 parents 1a74403 + 2255c59 commit f9a3ccb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions calendar/classes/local/event/forms/managesubscriptions.php
Expand Up @@ -140,6 +140,13 @@ public function validation($data, $files) {
$errors['url'] = get_string('errorrequiredurlorfile', 'calendar');
}

// Validate course/category event types (ensure appropriate field is also filled in).
if ($eventtype === 'course' && empty($data['courseid'])) {
$errors['courseid'] = get_string('selectacourse');
} else if ($eventtype === 'category' && empty($data['categoryid'])) {
$errors['categoryid'] = get_string('required');
}

return $errors;
}

Expand Down

0 comments on commit f9a3ccb

Please sign in to comment.