diff --git a/phpunit/functional/HtmlTest.php b/phpunit/functional/HtmlTest.php index 003a2c1bfc3..f8198bf0ec8 100644 --- a/phpunit/functional/HtmlTest.php +++ b/phpunit/functional/HtmlTest.php @@ -1004,7 +1004,8 @@ public function testGetScssFileHash() public function testCompileScssForPlugin() { - $compiled_scss = \Html::compileScss(['file' => '/plugins/tester/css/styles.scss']); + // FIXME remove the `@` operator once `scssphp/scssphp` and `league/uri` PHP 8.5 deprecation fixes will be released + $compiled_scss = @\Html::compileScss(['file' => '/plugins/tester/css/styles.scss']); // Strip comments to ease comparison. $compiled_scss = \preg_replace('~/\*.*\*/~s', '', $compiled_scss); diff --git a/src/Glpi/CustomObject/AbstractDefinition.php b/src/Glpi/CustomObject/AbstractDefinition.php index 92abd75e65d..d6411cfa86b 100644 --- a/src/Glpi/CustomObject/AbstractDefinition.php +++ b/src/Glpi/CustomObject/AbstractDefinition.php @@ -713,7 +713,7 @@ public function getTranslatedName(int $count = 1): string $translations = $this->getDecodedTranslationsField(); $language = Session::getLanguage(); - $current_translation = $translations[$language] ?? null; + $current_translation = $language !== null ? ($translations[$language] ?? null) : null; if ($current_translation === null) { return $this->fields['label']; } diff --git a/src/Session.php b/src/Session.php index 9e98890b449..4c3c2b528fd 100644 --- a/src/Session.php +++ b/src/Session.php @@ -1921,6 +1921,9 @@ public static function cleanIDORTokens() **/ public static function haveTranslations($itemtype, $field) { + if (!is_a($itemtype, CommonDropdown::class, true)) { + return false; + } return (isset($_SESSION['glpi_dropdowntranslations'][$itemtype]) && isset($_SESSION['glpi_dropdowntranslations'][$itemtype][$field]));