diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2022-05-27 09:59:12 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2022-05-27 09:59:12 +0000 |
| commit | 74cde461f8dd1b0b83ea9e031822603e9c280b56 (patch) | |
| tree | 1b1da650263c78e5df9d3751c7d74d0b8919d1d2 /app/controllers/admin | |
| parent | 956957c167dfc9675d1ec14a23e3fe75bf6c1a8d (diff) | |
fix for BIESt #971
Closes #971
Merge request studip/studip!578
Diffstat (limited to 'app/controllers/admin')
| -rw-r--r-- | app/controllers/admin/courses.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/controllers/admin/courses.php b/app/controllers/admin/courses.php index b0bf9cd..7835fe5 100644 --- a/app/controllers/admin/courses.php +++ b/app/controllers/admin/courses.php @@ -43,7 +43,7 @@ class Admin_CoursesController extends AuthenticatedController { //first get the active datafields of the user: $userSelectedElements = $this->getActiveElements(); - $activeDatafields = $userSelectedElements['datafields']; + $activeDatafields = $userSelectedElements['datafields'] ?? []; if (!$activeDatafields) { return []; @@ -189,7 +189,7 @@ class Admin_CoursesController extends AuthenticatedController } //if there are datafields in the list, draw their input fields, too: - if ($visibleElements['datafields']) { + if (!empty($visibleElements['datafields'])) { //The datafields entry contains an array with datafield-IDs. //We must fetch them from the database and show an appropriate widget //for each datafield. @@ -1190,7 +1190,7 @@ class Admin_CoursesController extends AuthenticatedController $filter->where("sem_classes.studygroup_mode = '0'"); // Get only children of given course - if ($params['parent_course']) { + if (!empty($params['parent_course'])) { $filter->where("parent_course = :parent", [ 'parent' => $params['parent_course'] @@ -1235,10 +1235,10 @@ class Admin_CoursesController extends AuthenticatedController return []; } - $seminars = array_map('reset', $courses); - - if (!empty($seminars)) { - foreach ($seminars as $seminar_id => $seminar) { + $seminars = []; + if (!empty($courses)) { + foreach ($courses as $seminar_id => $seminar) { + $seminars[$seminar_id] = $seminar[0]; $seminars[$seminar_id]['seminar_id'] = $seminar_id; $seminars[$seminar_id]['obj_type'] = 'sem'; $dozenten = $this->getTeacher($seminar_id); @@ -1253,7 +1253,7 @@ class Admin_CoursesController extends AuthenticatedController $seminars[$seminar_id]['navigation'] = MyRealmModel::getAdditionalNavigations( $seminar_id, $seminars[$seminar_id], - $seminars[$seminar_id]['sem_class'], + $seminars[$seminar_id]['sem_class'] ?? null, $GLOBALS['user']->id, $visit_data[$seminar_id] ); @@ -1264,8 +1264,8 @@ class Admin_CoursesController extends AuthenticatedController } if ((int)$this->selected_action === 17) { $seminars[$seminar_id]['admission_locked'] = false; - if ($seminar['course_set']) { - $set = new CourseSet($seminar['course_set']); + if ($seminar[0]['course_set']) { + $set = new CourseSet($seminar[0]['course_set']); if (!is_null($set) && $set->hasAdmissionRule('LockedAdmission')) { $seminars[$seminar_id]['admission_locked'] = 'locked'; } else { |
