Skip to content
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

Add explanation for when cHash is added in routing enhancer section #1470

Open
sypets opened this issue Aug 3, 2021 · 0 comments
Open

Add explanation for when cHash is added in routing enhancer section #1470

sypets opened this issue Aug 3, 2021 · 0 comments

Comments

@sypets
Copy link
Contributor

sypets commented Aug 3, 2021

The below refers to URLs with a limited set of parameters.


... or how to get rid of cHash in the URL.

There are a number of related questions online (e.g. on Stackoverflow, on Forge) and there is some explanation, but some of it is vague and not definitive. It might be a good idea to add the information to the docs

  • when a cHash is added to the URL
  • how to get rid of the cHash (reqirement, aspect, ...?)

Related docs / information

The requirements section exactly specifies what kind of parameter should be added to that route as regular expression. This way, it is configurable to only allow integer values for e.g. pagination. If the requirements are too loose, a URL signature parameter (“cHash”) is added to the end of the URL which cannot be removed.

https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Routing/AdvancedRoutingConfiguration.html?highlight=advanced%20routing#simple-enhancer

So what is too loose?

the cHash is also added if the restrictions are too loose or more than (I think) 10000 possibilities are returned.

https://stackoverflow.com/questions/57649210/typo3-routeenhancer-with-custom-valuemapper#comment101766166_57649210


Here, the solution is to implement StaticMappableAspectInterface: https://stackoverflow.com/questions/59643974/typo3-cms-9-lts-cacheable-extbase-action-but-no-chash-with-new-routing

Some solutions use a workaround:

e.g. here:

aspects:
      klinik:
        type: PersistedAliasMapper
        tableName: tx_hplusinfo_domain_model_klinik
        routeFieldName: uid

http://typo3.3.n7.nabble.com/routeEnhancers-Extabase-cHash-loswerden-tp292271p292275.html

Is it necessary to do this or would a requirements section work as well?

Links

questions / answers:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant