Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion phpunit/functional/HtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Glpi/CustomObject/AbstractDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down
3 changes: 3 additions & 0 deletions src/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
Expand Down
Loading