Project

General

Profile

Actions

Bug #92355

closed

Routing always generates cHash if there are no aspects

Added by Dmitry Dulepov over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-09-21
Due date:
% Done:

0%

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

Description

If there are no aspects, routing will always generate cHash for urls even though all parameters are successfully mapped.

Configiuration example:

  ArticleDetail:
    type: Extbase
    extension: Journal
    plugin: ArticleDetail
    routes:
      - {routePath: '/doi/{identifier}', _controller: 'Article::detail'}
    requirements:
      identifier: '[^/]+'
    defaultController: 'Article::detail'

Code that generates the link:

    <f:link.action action="detail" controller="Article" pluginName="ArticleDetail" extensionName="Journal" pageUid="{settings.params.detail}" arguments="{identifier: article.info.identifier}">
          <h4>{article.title}</h4>
    </f:link.action>

The url will look something like https://xyz.ddev.site/de/detail/doi/oi9Ahcha?cHash=xxxxxxxx This is not acceptable to the customer because in the existing TYPO3 v8 web site there were no cHash and having cHash in a newer TYPO3 version is seen as a disadvantage compared to previous TYPO3 versions.

I must tell that article identifiers are random strings, so none of stock aspects will work.

The only solution that I found is to create a dummy mapper:

class RemoveCHashAspect implements StaticMappableAspectInterface, \Countable
{
    public function generate(string $value): ?string
    {
        return $value;
    }

    public function resolve(string $value): ?string
    {
        return $value;
    }

    public function count()
    {
        return 1;
    }
}

and add it to the configuration:

    aspects:
      identifier:
        type: RemoveCHash

But this is an obvious step back from RealURL where such cases were handles smoothly since 2006. It looks strange to me that I need to create a whole class that does nothing just to get rid of cHash.

Please, fix this! cHash should not be appended when all parameters were successfully mapped to the url!


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Feature #93100: ExtbasePluginEnhancer produces unnecessary cHashUnder ReviewOliver Hader2020-12-17

Actions
Actions

Also available in: Atom PDF