]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(appinfo): navigation type is optional 36508/head
authorJoas Schilling <coding@schilljs.com>
Fri, 3 Feb 2023 08:52:37 +0000 (09:52 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 3 Feb 2023 08:52:37 +0000 (09:52 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/App/InfoParser.php
lib/private/NavigationManager.php

index 79a88b46236401ed12e94dacc9c2fc2c23fb1b82..c0f69e615bdf752a8bc3f8e1f41eeb54dcf80228 100644 (file)
@@ -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']);
index 2d1400714fea180d1590edaa075aa2958f51e43c..e3d5ac752d80444b3c94d28682cca9fd5500dfbb 100644 (file)
@@ -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()) {