0

After migrating our site from version 8 LTS to version 9 LTS, I have some configuration problems with the routing.

With RealURL we use the fixedPostVars, 'noMatch' => 'bypass'.

For example with this URL

http://Mysite/my-page/mysubpage
?tx_extension[action]=show
&tx_extension[controller]=Researchers
&tx_extension[fullName]=FirstNameWithÉ-LastName
&tx_extension[id]=37
&cHash=f077e6ab99d456c1d0431603186c32cf

We would like to have

http://Mysite/my-page/mysubpage/FirstNameWithC-LastNameWithe/37

For now I can get

http://Mysite/my-page/mysubpage/FirstNameWith%2527-LastName/37
?tx_extension%5Baction%5D=show
&tx_extension%5Bcontroller%5D=Researchers
&cHash=067d606ab30ace24e7cf347bdf89b011

I tried several configurations without success.

So how can I do to hide the controller, the action and the cHash.

Also, how to handle accented characters in URL.

This is my configuration for routeEnhancers

  ListResearchers:
    type: Plugin
    limitToPages:
      - 2706
      - 2707
    routePath: '/{name}/{uid}'
    namespace: 'tx_extension'
    _arguments:
      name: 'fullName'
      uid: 'id'
SteveLeg
  • 87
  • 12
  • Sound to me, like you wanna configure a `type: Extbase` instead of `type: Plugin`... https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Routing/AdvancedRoutingConfiguration.html#extbase-plugin-enhancer – Julian Hofmann May 16 '22 at 20:28
  • You are right. This config works but the hash is present ListResearchers: type: Extbase limitToPages: - 2706 - 2707 extension: ExtensionName plugin: PluginName routes: - routePath: '/{nom}/{uid}' _controller: 'Researchers::show' _arguments: nom: 'fullName' uid: 'id' – SteveLeg May 17 '22 at 18:21
  • Any hints how to disable cHash in URL? – SteveLeg May 17 '22 at 18:25
  • If the cHash is still present, any (default) parameter is still missing or undefined. – Julian Hofmann May 18 '22 at 06:53
  • 1
    `fullName` has a too huge value space to be there without `requirements`/`aspects`. That will produce cHash. In your case (string), you should use the `PersistedAliasMapper` or write a custom aspect. `uid` will need `requirements` (if you want to use it. You could get rid of it with `PersistedAliasMapper`) – Jonas Eberle May 18 '22 at 10:30
  • 1
    You were right @JonasEberle, giving each parameters an aspect and requirement hide the cHash. – SteveLeg May 18 '22 at 14:14
  • Very good. I'll add it as an answer. – Jonas Eberle May 19 '22 at 07:38

1 Answers1

1

fullName has a too huge value space to be there without requirements/aspects. That will produce ?cHash.

In your case (string), you can use the PersistedAliasMapper or write a custom aspect.

uid will need requirements. (If you want to use it. You could get rid of it with PersistedAliasMapper)

Jonas Eberle
  • 2,835
  • 1
  • 15
  • 25