Browse Source

fix(appinfo): navigation type is optional

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v26.0.0beta3
Joas Schilling 1 year ago
parent
commit
bf7fe04c4b
No account linked to committer's email address
2 changed files with 5 additions and 6 deletions
  1. 2
    1
      lib/private/App/InfoParser.php
  2. 3
    5
      lib/private/NavigationManager.php

+ 2
- 1
lib/private/App/InfoParser.php View 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']);

+ 3
- 5
lib/private/NavigationManager.php View 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()) {

Loading…
Cancel
Save