Skip to content

Commit 916de04

Browse files
nickvergessenPytal
authored andcommitted
fix(appinfo): navigation type is optional
Signed-off-by: Joas Schilling <[email protected]> (cherry picked from commit bf7fe04)
1 parent 0827cc8 commit 916de04

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/private/App/InfoParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ public function parse($file) {
226226
*/
227227
private function isNavigationItem($data): bool {
228228
// Allow settings navigation items with no route entry
229-
if ($data['type'] === 'settings') {
229+
$type = $data['type'] ?? 'link';
230+
if ($type === 'settings') {
230231
return isset($data['name']);
231232
}
232233
return isset($data['name'], $data['route']);

lib/private/NavigationManager.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,9 @@ private function init() {
305305
if (!isset($nav['name'])) {
306306
continue;
307307
}
308-
if (!isset($nav['route'])) {
309-
// Allow settings navigation items with no route entry, all other types require one
310-
if ($nav['type'] !== 'settings') {
311-
continue;
312-
}
308+
// Allow settings navigation items with no route entry, all other types require one
309+
if (!isset($nav['route']) && $nav['type'] !== 'settings') {
310+
continue;
313311
}
314312
$role = isset($nav['@attributes']['role']) ? $nav['@attributes']['role'] : 'all';
315313
if ($role === 'admin' && !$this->isAdmin()) {

0 commit comments

Comments
 (0)