summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Scherzinger <info@andy-scherzinger.de>2023-12-07 12:41:52 +0100
committerGitHub <noreply@github.com>2023-12-07 12:41:52 +0100
commitd147641484c6f5fd587d23dfc0fae052f4880df2 (patch)
tree2f6c5f1d8cdd26bb486b41cb229f1c3058db9d39
parent95f82d79cba31b5db1814e31bb0fcbe4e1621c4e (diff)
parentb82a7d6102dbae6460c7cfffff3a1eadc3041025 (diff)
downloadnextcloud-server-d147641484c6f5fd587d23dfc0fae052f4880df2.tar.gz
nextcloud-server-d147641484c6f5fd587d23dfc0fae052f4880df2.zip
Merge pull request #42088 from nextcloud/backport/42055/stable28
[stable28] enh(NavigationManager): Use ID as fallback for `app` property of entries
-rw-r--r--lib/private/NavigationManager.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index 27963b8a45d..17573d9db86 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -95,7 +95,10 @@ class NavigationManager implements INavigationManager {
return;
}
+ $id = $entry['id'];
+
$entry['active'] = false;
+ $entry['unread'] = $this->unreadCounters[$id] ?? 0;
if (!isset($entry['icon'])) {
$entry['icon'] = '';
}
@@ -106,9 +109,12 @@ class NavigationManager implements INavigationManager {
$entry['type'] = 'link';
}
- $id = $entry['id'];
- $entry['unread'] = $this->unreadCounters[$id] ?? 0;
if ($entry['type'] === 'link') {
+ // app might not be set when using closures, in this case try to fallback to ID
+ if (!isset($entry['app']) && $this->appManager->isEnabledForUser($id)) {
+ $entry['app'] = $id;
+ }
+
// This is the default app that will always be shown first
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;
// Set order from user defined app order