aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/App/InfoParser.php4
-rw-r--r--lib/private/NavigationManager.php10
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php
index 25f191502c3..79a88b46236 100644
--- a/lib/private/App/InfoParser.php
+++ b/lib/private/App/InfoParser.php
@@ -225,6 +225,10 @@ class InfoParser {
* @return bool
*/
private function isNavigationItem($data): bool {
+ // Allow settings navigation items with no route entry
+ if ($data['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 b78d9fa1ed8..2d1400714fe 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -301,11 +301,15 @@ class NavigationManager implements INavigationManager {
continue;
}
foreach ($info['navigations']['navigation'] as $key => $nav) {
+ $nav['type'] = $nav['type'] ?? 'link';
if (!isset($nav['name'])) {
continue;
}
if (!isset($nav['route'])) {
- continue;
+ // Allow settings navigation items with no route entry, all other types require one
+ if ($nav['type'] !== 'settings') {
+ continue;
+ }
}
$role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all';
if ($role === 'admin' && !$this->isAdmin()) {
@@ -314,8 +318,8 @@ class NavigationManager implements INavigationManager {
$l = $this->l10nFac->get($app);
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
$order = isset($nav['order']) ? $nav['order'] : 100;
- $type = isset($nav['type']) ? $nav['type'] : 'link';
- $route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : '';
+ $type = $nav['type'];
+ $route = !empty($nav['route']) ? $this->urlGenerator->linkToRoute($nav['route']) : '';
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';
foreach ([$icon, "$app.svg"] as $i) {
try {