aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-02-03 09:52:37 +0100
committerJoas Schilling <coding@schilljs.com>2023-02-03 09:52:37 +0100
commitbf7fe04c4b238f7c20dd3bb54c2f8df13cc0f6b8 (patch)
treeb33282a145a2a2d490859ea9750db2dfb4d4f152 /lib
parentc610d0d99b7ed6999dea78d532a9c6c8552cafff (diff)
downloadnextcloud-server-bf7fe04c4b238f7c20dd3bb54c2f8df13cc0f6b8.tar.gz
nextcloud-server-bf7fe04c4b238f7c20dd3bb54c2f8df13cc0f6b8.zip
fix(appinfo): navigation type is optional
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/InfoParser.php3
-rw-r--r--lib/private/NavigationManager.php8
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php
index 79a88b46236..c0f69e615bd 100644
--- a/lib/private/App/InfoParser.php
+++ b/lib/private/App/InfoParser.php
@@ -226,7 +226,8 @@ class InfoParser {
*/
private function isNavigationItem($data): bool {
// Allow settings navigation items with no route entry
- if ($data['type'] === 'settings') {
+ $type = $data['type'] ?? 'link';
+ if ($type === 'settings') {
return isset($data['name']);
}
return isset($data['name'], $data['route']);
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index 2d1400714fe..e3d5ac752d8 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -305,11 +305,9 @@ class NavigationManager implements INavigationManager {
if (!isset($nav['name'])) {
continue;
}
- if (!isset($nav['route'])) {
- // Allow settings navigation items with no route entry, all other types require one
- if ($nav['type'] !== 'settings') {
- continue;
- }
+ // Allow settings navigation items with no route entry, all other types require one
+ if (!isset($nav['route']) && $nav['type'] !== 'settings') {
+ continue;
}
$role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all';
if ($role === 'admin' && !$this->isAdmin()) {