mirror of
https://github.com/moodle/moodle.git
synced 2025-04-18 23:15:38 +02:00
course settings: MDL-18595: Fix regression caused by switching the course settings form to use the new date selector.
The bad commit was http://cvs.moodle.org/moodle/course/edit_form.php?r1=1.65&r2=1.66 Sorry everyone who was inconvenienced by this.
This commit is contained in:
parent
add53f6587
commit
1d693c8fd0
@ -52,18 +52,9 @@
|
||||
} // it'll be greyed out but we want these by default anyway.
|
||||
}
|
||||
$course->allowedmods = $allowedmods;
|
||||
|
||||
if ($course->enrolstartdate){
|
||||
$course->enrolstartdisabled = 0;
|
||||
}
|
||||
|
||||
if ($course->enrolenddate) {
|
||||
$course->enrolenddisabled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// first create the form
|
||||
$editform = new course_edit_form('edit.php', compact('course', 'category'));
|
||||
// now override defaults if course already exists
|
||||
@ -84,14 +75,6 @@
|
||||
/// process data if submitted
|
||||
|
||||
//preprocess data
|
||||
if ($data->enrolstartdisabled){
|
||||
$data->enrolstartdate = 0;
|
||||
}
|
||||
|
||||
if ($data->enrolenddisabled) {
|
||||
$data->enrolenddate = 0;
|
||||
}
|
||||
|
||||
$data->timemodified = time();
|
||||
|
||||
if (empty($course)) {
|
||||
|
@ -464,10 +464,9 @@ class course_edit_form extends moodleform {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data['enrolenddisabled'])){
|
||||
if ($data['enrolenddate'] <= $data['enrolstartdate']){
|
||||
$errors['enroldateendgrp'] = get_string('enrolenddaterror');
|
||||
}
|
||||
if (!empty($data['enrolstartdate']) && !empty($data['enrolenddate']) &&
|
||||
$data['enrolenddate'] <= $data['enrolstartdate']){
|
||||
$errors['enrolenddate'] = get_string('enrolenddaterror');
|
||||
}
|
||||
|
||||
if (!empty($CFG->enrol_manual_usepasswordpolicy) and isset($data['enrolpassword']) and $data['enrolpassword'] != '') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user