Skip to content

Commit d147641

Browse files
Merge pull request #42088 from nextcloud/backport/42055/stable28
[stable28] enh(NavigationManager): Use ID as fallback for `app` property of entries
2 parents 95f82d7 + b82a7d6 commit d147641

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/private/NavigationManager.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ public function add($entry) {
9595
return;
9696
}
9797

98+
$id = $entry['id'];
99+
98100
$entry['active'] = false;
101+
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
99102
if (!isset($entry['icon'])) {
100103
$entry['icon'] = '';
101104
}
@@ -106,9 +109,12 @@ public function add($entry) {
106109
$entry['type'] = 'link';
107110
}
108111

109-
$id = $entry['id'];
110-
$entry['unread'] = $this->unreadCounters[$id] ?? 0;
111112
if ($entry['type'] === 'link') {
113+
// app might not be set when using closures, in this case try to fallback to ID
114+
if (!isset($entry['app']) && $this->appManager->isEnabledForUser($id)) {
115+
$entry['app'] = $id;
116+
}
117+
112118
// This is the default app that will always be shown first
113119
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;
114120
// Set order from user defined app order

0 commit comments

Comments
 (0)