fix(appinfo): navigation type is optional

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/36508/head
Joas Schilling 3 years ago
parent c610d0d99b
commit bf7fe04c4b
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 3
      lib/private/App/InfoParser.php
  2. 8
      lib/private/NavigationManager.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']);

@ -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()) {

Loading…
Cancel
Save