Problem/Motivation
Imagine the following state:
We have node/10
with the following aliases alias-1
and alias-2
.
When requested /router/translate-path?path=/alias-1
, there is a redirect section with alias-2
.
When requested /router/translate-path?path=/node/10
, there is no redirect section.
The issue is that Drupal's routing behavior is different in this way:
- Opening
alias-1
redirects to alias-2
.
- Opening
node/10
redirects to alias-2
.
Essentially this is the path alias, and not a redirect in Drupal, so decoupled router is not showing the redirect section (in it's current implementation).
In a decoupled scenario we should consider marking this as a redirect here.
Possible workaround on client side:
Once we get the resolved path and it is different than the requested one for route translation, do a redirect.
Though the response is not hinting the need for it in any way.
Proposed resolution
1. Have path aliases added in consideration for redirects section in the router.
2. Have a reasonable explanation why not and documented in the module's README file.
Remaining tasks
Discussion
(eventually) Patch.
... And the rest.
User interface changes
None.
API changes
Show the redirect section when resolving canonical paths that have aliases.
Data model changes
None expected.
Release notes snippet
TBD.