Bug #88714

f:link.action does not allow to render a link without a cHash when generating a dynamic route with dynamic arguments (extbase route enhancer)

Added by Denis Mir 14 days ago.

Should have
Target version:
Start date:
Due date:
% Done:


TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


We are trying to render a dynamic route with the "f:link.action" viewhelper like this:

<f:link.action class="blog__stroy" action="show" extensionName="blog" pluginName="blog" pageUid="2" arguments="{slug: story.slug}" noCacheHash="true" target="_blank">

In this case the "noCacheHash" parameter gets ignored and the link always gets generated with the cHash.

Digging deeper I found that the route cause is the "PageRouter" which does the following in the generateUri method:

// cHash is never considered because cHash is built by this very method.

In the documentation it says:

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.

But what are "too loose requirements"? When looking at the code in the PageRouter there is not evaluation whatsoever it just does:

if ($matchedRoute && $pageRouteResult && !empty($pageRouteResult->getDynamicArguments())) {
            $cacheHash = $this->generateCacheHash($pageId, $pageRouteResult);

            if (!empty($cacheHash)) {
                $queryArguments = $pageRouteResult->getQueryArguments();
                $queryArguments['cHash'] = $cacheHash;
                $uri = $uri->withQuery(http_build_query($queryArguments, '', '&', PHP_QUERY_RFC3986));

So as long as there are dynamic arguments in the route the cHash is enforced. We just don't want and don't need the cHash since we only allow uuids for the dynamic argument part compared against the database. I think this is a common use case which should be supported. Always enforcing the cHash can't be the solution.

Also available in: Atom PDF