typo3typo3-11.xtypo3-12.x

TYPO3 v12: RouteEnhancer is not working and makes pages inaccessible


The RouteEnhancer config I've been using in v11 is just not working when any kind of argument is getting passed (via url) now that I am using it in v12.

Page tries to load, puts the URL up top, but stays/loads the site from before. No error, no stack trace. End result is the wrong url on a page, with elements not working.

Weird thing: link gets generated like it should in html, has a cHash. When I try to either click on that link or gather the link from the html via F12 and try that, the cHash dissapears.

Is there some config change that is not well documented or that I am not understanding? I am looking for any idea on what it could be, not necessarily a solution.

Goal is just to pass what is in that url to the function as string, while not having the native url "?tx_[....]" parts. No Database lookup, nothing.

Thanks in advance!

Example Config:

routeEnhancers:
  SomethingList:
    type: Extbase
    extension: Extension
    plugin: Plugin
    namespace: tx_Extension_plugin
    routes:
      - 
        routePath: '/'
        _controller: 'Plugin::list'
      -
        routePath: '/search'
        _controller: 'Plugin::search'
      -
        routePath: '/detail/{aId}'
        _controller: 'Plugin::show'
        _arguments:
          aId: aId
    defaultController: 'Plugin::searchList'

"/" Works.
"/search" does not because it wants an argument (via "?tx_[....]")
"/detail/{aId}" also does not work.

Thing is, in v11? All of them work


Solution

  • What ended up solving my problem was to use LimitToPages and avoid paths like '/'.

    It seems that if multiple such paths are present, even though only one page actually calls the plugin, it still initiates as if the route applies to ALL PAGES.

    So it ends up conflicting and not working (probably throws an error somewhere as well, have yet to find where though). Conflicting, as in, multiple paths that are the same, which '/' is predistined for.

    It seems that sometimes the problem is still there even with LimitToPages enabled. This may be inaccurate, but it feels like in some cases only using both LimitToPages and changing the path made a difference.

    Heinz Schilling 's answer is still valid to remove the chash, and even caused my links, that were broken ([...]?tx[...]), to at least appear right([..]/detail/[..]), even if they turned out non functional because of the above issues.

    Thank you to all that helped!