- Issue created by @mparker17
- Status changed to Needs review
about 1 year ago 3:07pm 20 March 2023 - π¨π¦Canada mparker17 UTC-4
Here is a patch with tests! Reviews welcome!
- Status changed to Needs work
about 1 year ago 6:34pm 23 March 2023 - π¨π¦Canada mparker17 UTC-4
I think I will need to add the paths <nolink>, <button>, and <current> to the list of disallowed paths (these are defined in
web/core/modules/system/system.routing.yml
with <front> and <none>, which are already disallowed). - Status changed to Needs review
about 1 year ago 8:26pm 23 March 2023 - π¨π¦Canada mparker17 UTC-4
Here's an updated patch; reviews welcome. Here's a deeper dive into why I wrote the patch this way...
The special routes/paths we handle as special cases in the validation function are defined in
web/core/modules/system/system.routing.yml
as follows...'<front>': path: '/' defaults: _title: Home requirements: _access: 'TRUE' '<none>': path: '' options: _no_path: TRUE requirements: _access: 'TRUE' '<nolink>': path: '' options: _no_path: TRUE requirements: _access: 'TRUE' '<button>': path: '' options: _no_path: TRUE requirements: _access: 'TRUE' '<current>': path: '<current>'
Note that <front> and <current> both have an explicitly-set
path
(and note that both the route name and path for <current> is the same string); but the other special routes do not.Our validation code is looking at paths, not route names. We want to avoid unexpected behavior, so we disallow the paths
/
and<current>
.Setting the sitemap path to one of the reserved route names that are not also paths (<front>, <none>, <nolink> and <button>) should work just fine, but it would be confusing to people accustomed to see them interpreted as route names elsewhere in the Drupal UI (and of limited use in the real world), so we disallow those as well.
... Hopefully that makes sense!
- Status changed to RTBC
2 months ago 10:08pm 30 March 2024 - π¨π¦Canada mparker17 UTC-4
Awesome, thanks @firewaller!
I've created a merge request and fixed some lints. If everything works, I will merge tomorrow.
-
mparker17 β
committed ea3e82fa on 8.x-2.x
Issue #3348769 by mparker17, firewaller: Customize the sitemap path
-
mparker17 β
committed ea3e82fa on 8.x-2.x
- Status changed to Fixed
2 months ago 1:55pm 1 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.