use the sessions language id instead of the user's default in `I18nDatabaseObjectList`
authormutec <mysterycode@mysterycode.de>
Tue, 10 Aug 2021 10:06:27 +0000 (12:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 10 Aug 2021 10:18:29 +0000 (12:18 +0200)
`WCF::getUser()->languageID` doesn't return a valid language id as integer in every case. Additionally we (normally) want to use a specific language or the session's language - which might be different from the user's default in some moments.

see #4407

wcfsetup/install/files/lib/data/I18nDatabaseObjectList.class.php

index 4ae5d98aeb1c4bfac6d79298a54f35f61a309d95..cd278ed9214cb9a22547d3306cd32c839263304e 100644 (file)
@@ -39,7 +39,7 @@ abstract class I18nDatabaseObjectList extends DatabaseObjectList
         parent::__construct();
 
         if ($languageID === null) {
-            $languageID = WCF::getUser()->languageID;
+            $languageID = WCF::getLanguage()->languageID;
         }
 
         if (!empty($this->i18nFields)) {