-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
No redirect is created for shrotcuts #67
Comments
@gjwnc Thanks for your issue. I've fixed the 4.0 branch, which had indeed commits of the 5.0 version, due to a wrong merge. Regarding your proposal, i think it's not a viable solution to extend the FrontendNodeRoutePartHandler. But ATM I don't know a working solution to render the "real" URI of a shortcut node, as it is to deep in the routing. Moreover from my POV it's rather a bug, that you are able to call (resolve) the "real" shortcut node URI, than a feature. |
What do you mean? |
No sorry, i mixed it up. |
When you move a shortcut no redirect is created for the URL the shortcut was reachable before the move.
The reason is, that NodeRedirectService::createRedirectFrom compares the URI of the old and new destination. This URl is created via
NodeRedirectService::buildUriPathForNode
which uses the UriBuilder which in turn uses FrontendNodeRoutePartHandler::resolveShortcutNode to get the target URI. Now if you compare the target URI of a moved shortcut it does not change and no redirect is created.I've fixed this in a project using an aspect for
NodeRedirectService::buildUriPathForNode
and usingFrontendNodeRoutePartHandler::resolveRoutePathForNode(NodeInterface $node)
via a new class inheriting fromFrontendNodeRoutePartHandler
to make theprotected
methodresolveRoutePathForNode
public
via an intermediate method, like this:Shall I provide a PR for this case, by also using the
FrontendNodeRoutePartHandlerRedirectHelper
to get direct access of a node's path without using the uriBuilder in case of a shortcut? Tbh, I don't like my solution, but currently, afaik, there is no way to retrieve the URL of a shortcut itself. The uriBuilder always resolves the shortcut because of theFrontendNodeRoutePartHandler
.But I could provide a PR for Neos < 9 if requested. But I'm not sure how to create the PR, because branch 4.0 already contains changes related to Neos 9.
From reading the new Neos 9 FrontendNodeRoutePartHandler, the shortcut will also be resolve to it's final target, thus Neos 9 doesn't seem to fix this.
Any ideas on how to proceed?
The text was updated successfully, but these errors were encountered: