From 222976b86646c206068cc0bd0209239f3b4ebc74 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Tue, 17 May 2022 16:32:10 +0000
Subject: [PATCH] return i18n fields as string, fixes #1069

Closes #1069

Merge request studip/studip!634
---
 lib/classes/globalsearch/GlobalSearchCourses.php   | 2 +-
 lib/classes/globalsearch/GlobalSearchMyCourses.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/classes/globalsearch/GlobalSearchCourses.php b/lib/classes/globalsearch/GlobalSearchCourses.php
index 4cc3c0f904b..df9de0fa98e 100644
--- a/lib/classes/globalsearch/GlobalSearchCourses.php
+++ b/lib/classes/globalsearch/GlobalSearchCourses.php
@@ -204,7 +204,7 @@ class GlobalSearchCourses extends GlobalSearchModule implements GlobalSearchFull
             'number'        => self::mark($course->veranstaltungsnummer, $search),
             'name'          => self::mark($course->getFullname(), $search),
             'url'           => URLHelper::getURL("dispatch.php/course/details/index/{$course->id}", [], true),
-            'date'          => $semester->token ?: $semester->name,
+            'date'          => (string) $semester->token ?: (string) $semester->name,
             'dates'         => $turnus_string,
             'has_children'  => count($course->children) > 0,
             'children'      => $result_children,
diff --git a/lib/classes/globalsearch/GlobalSearchMyCourses.php b/lib/classes/globalsearch/GlobalSearchMyCourses.php
index c761a102c20..6a5bb0fc2a4 100644
--- a/lib/classes/globalsearch/GlobalSearchMyCourses.php
+++ b/lib/classes/globalsearch/GlobalSearchMyCourses.php
@@ -146,7 +146,7 @@ class GlobalSearchMyCourses extends GlobalSearchModule
             'number'        => self::mark($course->veranstaltungsnummer, $search),
             'name'          => self::mark($course->getFullname(), $search),
             'url'           => URLHelper::getURL('seminar_main.php', ['cid' => $course->id], true),
-            'date'          => $semester->token ?: $semester->name,
+            'date'          => (string) $semester->token ?: (string) $semester->name,
             'dates'         => $turnus_string,
             'has_children'  => count($course->children) > 0,
             'children'      => $result_children,
-- 
GitLab