MDL-49701 mod_lesson: open time should be before close time
Conflicts: mod/lesson/mod_form.php
This commit is contained in:
@@ -337,6 +337,13 @@ class mod_lesson_mod_form extends moodleform_mod {
|
||||
if (empty($data['maxtime']) and !empty($data['timed'])) {
|
||||
$errors['timedgrp'] = get_string('err_numeric', 'form');
|
||||
}
|
||||
|
||||
// Check open and close times are consistent.
|
||||
if ($data['available'] != 0 && $data['deadline'] != 0 &&
|
||||
$data['deadline'] < $data['available']) {
|
||||
$errors['deadline'] = get_string('closebeforeopen', 'lesson');
|
||||
}
|
||||
|
||||
if (!empty($data['usepassword']) && empty($data['password'])) {
|
||||
$errors['password'] = get_string('emptypassword', 'lesson');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user