-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow empty route for navigation entries #36449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/backport to stable25 |
|
|
| </xs:simpleType> | ||
|
|
||
| <xs:simpleType name="route"> | ||
| <xs:restriction base="non-empty-string"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead allowing empty, just allow no occurrences of the route tag?🤔
Sounds easier and more straight forward, but might require additional PHP fallbacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was exactly the initial idea, but because this is needed for #36232 for NC25 accessibility, the minimally invasive solution here prevents the need to backport some potentially breaking changes to i.e. https://github.com/nextcloud/server/blob/ca3f53ab88b06c8ceea5d7991ff40641a9820728/lib/private/NavigationManager.php and https://github.com/nextcloud/server/blob/ca3f53ab88b06c8ceea5d7991ff40641a9820728/lib/private/App/InfoParser.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the necessary PHP patch:
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index b78d9fa1ed8..f24a2f0ac25 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -315,7 +315,8 @@ class NavigationManager implements INavigationManager {
$id = $nav['id'] ?? $app . ($key === 0 ? '' : $key);
$order = isset($nav['order']) ? $nav['order'] : 100;
$type = isset($nav['type']) ? $nav['type'] : 'link';
- $route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : '';
+ $route = $nav['route'] ?? '';
+ $route = $route !== '' ? $this->urlGenerator->linkToRoute($route) : '';
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';
foreach ([$icon, "$app.svg"] as $i) {
try {
nickvergessen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
- For xmllint Signed-off-by: Christopher Ng <[email protected]>
2703dd2 to
c8c010b
Compare
|
Superseded by #36508 |
Summary
Some apps register navigation entries with empty routes e.g.
server/apps/user_status/appinfo/info.xml
Line 18 in 9035be6
This allows these entries to pass
xmllintused in https://github.com/nextcloud/.github/blob/ff4a6f1eacb53e4d3b5721e57743eb64242178a7/workflow-templates/lint-info-xml.ymlChecklist