neos-development-collection icon indicating copy to clipboard operation
neos-development-collection copied to clipboard

FrontendNodeRoutePartHandler should support partial matches

Open neos-bot opened this issue 11 years ago • 4 comments

Jira issue originally created by user @bwaidelich:

imagine following route setup:

-
  uriPattern: '{node}/{--plugin.product}'
  defaults:
    '@package':    'TYPO3.Neos'
    '@controller': 'Frontend\Node'
    '@action':     'show'
    '@format':     'html'
  routeParts:
    'node':
      handler:     'TYPO3\Neos\Routing\FrontendNodeRoutePartHandlerInterface'
``` (simplified)

Now when requesting **products/some-product* the route won't match even if the node *products* exists, because the `FrontendNodeRoutePartHandler` always compares the *whole** request path (until the next static part in the uriPattern).

To resolve this, the handler should only match the path **as far as possible** and then leave the exceeding path (in this case "some-product") for the next `RoutePart` to match.

Currently you have to add a static part to the uriPattern to get it work:

uriPatthen: '{node}/products/{--plugin.product}'


 Jira-URL: https://jira.neos.io/browse/NEOS-1085

neos-bot avatar Mar 12 '15 11:03 neos-bot

Any update on this? It would be great if the static part could be avoided.

sualko avatar Sep 23 '16 09:09 sualko

There's no-one assigned to the ticket so it's probably not a high prio currently for anyone of the team. If you need this feel free to give it a shot. Let us know if you need help with that

bwaidelich avatar Sep 23 '16 10:09 bwaidelich

Thanks for your reply. I am willing to fix this, but I have no clue where to start. I looked briefly at the code and added some debug messages, but for an newbie it is very hard to find a starting point. I guess it is also hard for you to give me a hint, if it is related to the FrontendNodeRoutePartHandlerInterface or same deeper core concepts/functions. But any advice will be appreciated.

sualko avatar Oct 06 '16 07:10 sualko

This is a non trivial matter. I spent quite some time on it and it's not that easy.

kitsunet avatar Oct 06 '16 10:10 kitsunet