diff --git a/app/controllers/course/timesrooms.php b/app/controllers/course/timesrooms.php index 887ab112a7ce90a901e28cec69a24ee3a1d673ab..f21685c84b0c8dfc8934a81071109ba5d0a6ac3c 100644 --- a/app/controllers/course/timesrooms.php +++ b/app/controllers/course/timesrooms.php @@ -410,9 +410,14 @@ class Course_TimesroomsController extends AuthenticatedController // Set assigned teachers $assigned_teachers = Request::optionArray('assigned_teachers'); $dozenten = $this->course->getMembers(); - $this->dozenten = []; - if(count($dozenten) !== count($assigned_teachers)) { - $this->dozenten = User::findMany($assigned_teachers); + if (count($assigned_teachers) === count($dozenten) || empty($assigned_teachers)) { + //The amount of lecturers of the course date is the same as the amount of lecturers of the course + //or no lecturers are assigned to the course date. + $termin->dozenten = []; + } else { + //The assigned lecturers (amount or persons) have been changed in the form. + //In those cases, the lecturers of the course date have to be set. + $termin->dozenten = User::findMany($assigned_teachers); } // Set assigned groups