Bug #93840

RouteEnhancers with no arguments don't work

Added by Michael Stopp about 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2021-03-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I've had a similar problems as described in this post https://stackoverflow.com/questions/59563985/typo3-9-routing-enhancers-with-no-arguments, when trying to define a routing config for the most basic use cases.

For example, in a shopping cart application, all data is stored in the user session, so no arguments are required to call any of the actions. I tried something like this:

routeEnhancers:
  CartPlugin:
    type: Extbase
    extension: MyCart
    plugin: Cart
    routes:
      - { routePath: '/mycart/', _controller: 'Cart::cart' }
      - { routePath: '/summary/', _controller: 'Cart::summary' }
      - { routePath: '/confirmation/', _controller: 'Cart::confirm' }
    defaultController: 'Cart::cart'

The links were created correctly, but when clicking them you would get a 404. Why doesn't this work?
There is no ambiguity in the route paths. There are no parameters that could be wrong or missing or not meeting the requirements.

The documentation has a similar example for rewriting the list action of News, with just a route path + controller without any parameters, which suggests this should be possible.

I've had complicated cases with lots of parameters, own aspects, all sorts of sophisticated mappings, which work very well. So why doesn't such a basic configuration work correctly? Am I missing something? This should be simple (maybe not to code, but to configure).

No data to display

Also available in: Atom PDF