diff --git a/src/Item_SoftwareLicense.php b/src/Item_SoftwareLicense.php index 14897ca866f..4a76ccf2c1b 100644 --- a/src/Item_SoftwareLicense.php +++ b/src/Item_SoftwareLicense.php @@ -783,7 +783,7 @@ function updateItemDropdown(itemtype_el) { 'glpi_softwarelicenses.name AS license', 'glpi_softwarelicenses.id AS vID', 'glpi_softwarelicenses.softwares_id AS softid', - "$users_table.name AS itemname", + User::getFriendlyNameFields('itemname'), "$users_table.id AS iID", new QueryExpression($DB::quoteValue(User::class), 'item_type'), new QueryExpression($DB::quoteValue(''), "serial"), diff --git a/src/User.php b/src/User.php index cb566d0d508..54534ffc2c9 100644 --- a/src/User.php +++ b/src/User.php @@ -6735,8 +6735,8 @@ public static function getFriendlyNameFields(string $alias = "name") $table = self::getTable(); return QueryFunction::if( condition: [ - "$table.$first" => ['<>' => ''], - "$table.$second" => ['<>' => ''] + "$table.$first" => ['<>', ''], + "$table.$second" => ['<>', ''] ], true_expression: QueryFunction::concat(["$table.$first", new QueryExpression($DB::quoteValue(' ')), "$table.$second"]), false_expression: $table . '.' . self::getNameField(),