From 3cdf73bc9026e6b2798867ad75c2b85b16c2f412 Mon Sep 17 00:00:00 2001
From: mjansen <mjansen@databay.de>
Date: Tue, 14 Nov 2023 20:22:52 +0100
Subject: [PATCH] Forum: Fix language for `CoPage`

See: https://mantis.ilias.de/view.php?id=38448
(cherry picked from commit a7dddaf612d02354ca430443d7b4e9bc3db52981)
---
 .../CoPage/class.ilForumPageCommandForwarder.php    | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/Modules/Forum/classes/CoPage/class.ilForumPageCommandForwarder.php b/Modules/Forum/classes/CoPage/class.ilForumPageCommandForwarder.php
index 3ad5764ce92d..a7bcce4ac3c4 100644
--- a/Modules/Forum/classes/CoPage/class.ilForumPageCommandForwarder.php
+++ b/Modules/Forum/classes/CoPage/class.ilForumPageCommandForwarder.php
@@ -37,6 +37,7 @@ class ilForumPageCommandForwarder implements ilForumObjectConstants
      * presentation mode for embedded presentation, e.g. in a kiosk mode
      */
     public const PRESENTATION_MODE_EMBEDDED_PRESENTATION = 'PRESENTATION_MODE_EMBEDDED_PRESENTATION';
+    public const DEFAULT_LANGUAGE = '-';
 
     protected string $presentationMode = self::PRESENTATION_MODE_EDITING;
     protected ilCtrlInterface $ctrl;
@@ -195,14 +196,11 @@ public function forward(string $ctrlLink = ''): string
         switch ($this->presentationMode) {
             case self::PRESENTATION_MODE_EDITING:
 
-                $pageObjectGui = $this->buildEditingPageObjectGUI('');
+                $pageObjectGui = $this->buildEditingPageObjectGUI(self::DEFAULT_LANGUAGE);
                 return (string) $this->ctrl->forwardCommand($pageObjectGui);
 
             case self::PRESENTATION_MODE_PRESENTATION:
-                $ot = ilObjectTranslation::getInstance($this->parentObject->getId());
-                $language = $ot->getEffectiveContentLang($this->actor->getCurrentLanguage(), $this->parentObject->getType());
-
-                $pageObjectGUI = $this->buildPresentationPageObjectGUI($language);
+                $pageObjectGUI = $this->buildPresentationPageObjectGUI(self::DEFAULT_LANGUAGE);
 
                 if (is_string($ctrlLink) && $ctrlLink !== '') {
                     $pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);
@@ -213,10 +211,7 @@ public function forward(string $ctrlLink = ''): string
                 return $this->ctrl->getHTML($pageObjectGUI);
 
             case self::PRESENTATION_MODE_EMBEDDED_PRESENTATION:
-                $ot = ilObjectTranslation::getInstance($this->parentObject->getId());
-                $language = $ot->getEffectiveContentLang($this->actor->getCurrentLanguage(), $this->parentObject->getType());
-
-                $pageObjectGUI = $this->buildEmbeddedPresentationPageObjectGUI($language);
+                $pageObjectGUI = $this->buildEmbeddedPresentationPageObjectGUI(self::DEFAULT_LANGUAGE);
 
                 if (is_string($ctrlLink) && $ctrlLink !== '') {
                     $pageObjectGUI->setFileDownloadLink($ctrlLink . '&cmd=' . self::UI_CMD_COPAGE_DOWNLOAD_FILE);