diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2023-11-30 10:22:44 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-11-30 10:22:44 +0000 |
| commit | 1dc25b5dacc2fb95d73cc1f81e4a9779c843a3f7 (patch) | |
| tree | bb4c8e727fc2da95ddbdb3ba3b82561b02c94c55 /lib/models/CourseEvent.class.php | |
| parent | d158072669339959c0990e01888f75ebf5850007 (diff) | |
prevent error, closes #3521
Closes #3521
Merge request studip/studip!2406
Diffstat (limited to 'lib/models/CourseEvent.class.php')
| -rw-r--r-- | lib/models/CourseEvent.class.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/models/CourseEvent.class.php b/lib/models/CourseEvent.class.php index 0dee26a..971eca3 100644 --- a/lib/models/CourseEvent.class.php +++ b/lib/models/CourseEvent.class.php @@ -176,12 +176,15 @@ class CourseEvent extends CourseDate implements Event /** * Returns the name of the category. * - * @return string the name of the category + * @return array|string the name of the category */ public function toStringCategories($as_array = false) { $category = ''; - if ($this->havePermission(Event::PERMISSION_READABLE)) { + if ( + $this->havePermission(Event::PERMISSION_READABLE) + && !empty($GLOBALS['TERMIN_TYP'][$this->getCategory()]) + ) { $category = $GLOBALS['TERMIN_TYP'][$this->getCategory()]['name']; } return $as_array ? [$category] : $category; |
