diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-09-30 10:15:54 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-10-02 08:52:36 +0200 |
| commit | 178f20b7ebe26ab25f96c9eb1a82769f31294547 (patch) | |
| tree | 703dd30a5728322d92ffd66a2d89e347c1f6f20c /lib/classes/coursewizardsteps | |
| parent | c0a1b121d779a75ec2af8e6236d1c1a1e3321362 (diff) | |
prevent many warnings regarding php8 on main, fixes #4631
Closes #4631
Merge request studip/studip!3448
Diffstat (limited to 'lib/classes/coursewizardsteps')
| -rw-r--r-- | lib/classes/coursewizardsteps/AdvancedBasicDataWizardStep.php | 8 | ||||
| -rw-r--r-- | lib/classes/coursewizardsteps/BasicDataWizardStep.php | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/classes/coursewizardsteps/AdvancedBasicDataWizardStep.php b/lib/classes/coursewizardsteps/AdvancedBasicDataWizardStep.php index 780f837..9e364e6 100644 --- a/lib/classes/coursewizardsteps/AdvancedBasicDataWizardStep.php +++ b/lib/classes/coursewizardsteps/AdvancedBasicDataWizardStep.php @@ -31,7 +31,7 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep $values = $this->adjustValues($values); // We only need our own stored values here. - if ($values[__CLASS__]['studygroup']) { + if (!empty($values[__CLASS__]['studygroup'])) { return parent::getStepTemplate($values, $stepnumber, $temp_id); } @@ -44,7 +44,7 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep return ''; } - $values = $this->makeI18N($values[__CLASS__], ['name', 'description', 'subtitle', 'kind']); + $values = $this->makeI18N($values[__CLASS__] ?? [], ['name', 'description', 'subtitle', 'kind']); $template->set_attribute('values', array_merge($template->values, $values)); @@ -83,7 +83,7 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep } // Studygroup? -> nothing to do here - if ($values[__CLASS__]['studygroup']) { + if (!empty($values[__CLASS__]['studygroup'])) { return $course; } @@ -117,7 +117,7 @@ class AdvancedBasicDataWizardStep extends BasicDataWizardStep if (!isset($values[__CLASS__]) && isset($values[$parent_class])) { $values[__CLASS__] = $values[$parent_class]; } else { - $values[$parent_class] = $values[__CLASS__]; + $values[$parent_class] = $values[__CLASS__] ?? []; } return $values; diff --git a/lib/classes/coursewizardsteps/BasicDataWizardStep.php b/lib/classes/coursewizardsteps/BasicDataWizardStep.php index fe7364a..ec441eb 100644 --- a/lib/classes/coursewizardsteps/BasicDataWizardStep.php +++ b/lib/classes/coursewizardsteps/BasicDataWizardStep.php @@ -534,9 +534,10 @@ class BasicDataWizardStep implements CourseWizardStep } } - public function getSearch($course_type, $institute_ids, $exclude_lecturers = [],$exclude_tutors = []) + public function getSearch($course_type) { - if (SeminarCategories::getByTypeId($course_type)->only_inst_user) { + $category = SeminarCategories::getByTypeId($course_type); + if ($category && $category->only_inst_user) { $search = 'user_inst'; } else { $search = 'user'; |
