mirror of
https://github.com/nextcloud/server.git
synced 2026-04-21 14:23:17 -04:00
fix(appinfo): navigation type is optional
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c610d0d99b
commit
bf7fe04c4b
2 changed files with 5 additions and 6 deletions
|
|
@ -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…
Reference in a new issue