fix(NavigationManager): Make entry order always an integer

Signed-off-by: provokateurin <kate@provokateurin.de>
This commit is contained in:
provokateurin 2024-05-30 16:59:04 +02:00
parent 8965b70228
commit 0a7fcde906
No known key found for this signature in database
3 changed files with 4 additions and 11 deletions

View file

@ -26,7 +26,7 @@ namespace OCA\Core;
*
* @psalm-type CoreNavigationEntry = array{
* id: string,
* order: int|string,
* order: int,
* href: string,
* icon: string,
* type: string,

View file

@ -232,15 +232,8 @@
"type": "string"
},
"order": {
"oneOf": [
{
"type": "integer",
"format": "int64"
},
{
"type": "string"
}
]
"type": "integer",
"format": "int64"
},
"href": {
"type": "string"

View file

@ -95,7 +95,7 @@ class NavigationManager implements INavigationManager {
// This is the default app that will always be shown first
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;
// Set order from user defined app order
$entry['order'] = $this->customAppOrder[$id]['order'] ?? $entry['order'] ?? 100;
$entry['order'] = (int)($this->customAppOrder[$id]['order'] ?? $entry['order'] ?? 100);
}
$this->entries[$id] = $entry;