Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/app-info-shipped.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@
</xs:simpleType>

<xs:simpleType name="route">
<xs:restriction base="non-empty-string">
Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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 {

<xs:pattern value="[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+){2}"/>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+){2})?"/>
</xs:restriction>
</xs:simpleType>

Expand Down
4 changes: 2 additions & 2 deletions resources/app-info.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,8 @@
</xs:simpleType>

<xs:simpleType name="route">
<xs:restriction base="non-empty-string">
<xs:pattern value="[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+){2}"/>
<xs:restriction base="xs:string">
<xs:pattern value="([0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+){2})?"/>
</xs:restriction>
</xs:simpleType>

Expand Down