From 1dc25b5dacc2fb95d73cc1f81e4a9779c843a3f7 Mon Sep 17 00:00:00 2001 From: David Siegfried <david.siegfried@uni-vechta.de> Date: Thu, 30 Nov 2023 10:22:44 +0000 Subject: [PATCH] prevent error, closes #3521 Closes #3521 Merge request studip/studip!2406 --- lib/models/CourseEvent.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/models/CourseEvent.class.php b/lib/models/CourseEvent.class.php index 0dee26a8c59..971eca38854 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; -- GitLab