MDL-66489 enrol: prevent warning when the duration field is disabled

This commit is contained in:
Shamim Rezaie 2019-08-28 08:16:05 +10:00
parent 2d4ce64dde
commit 3919150d37

View File

@ -87,7 +87,7 @@ if ($mform->is_cancelled()) {
redirect($returnurl);
} else if ($data = $mform->get_data()) {
if ($data->duration && $data->timeend == 0) {
if (!empty($data->duration) && $data->timeend == 0) {
$data->timeend = $data->timestart + $data->duration;
}
if ($manager->edit_enrolment($ue, $data)) {