Skip to content

Commit

Permalink
fix(appinfo): navigation type is optional
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Feb 3, 2023
1 parent c610d0d commit bf7fe04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/private/App/InfoParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ public function parse($file) {
*/
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']);
Expand Down
8 changes: 3 additions & 5 deletions lib/private/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,9 @@ private function init() {
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()) {
Expand Down

0 comments on commit bf7fe04

Please sign in to comment.