Project

General

Profile

Actions

Bug #91323

closed

Route enhancer kills unregistered get parameters

Added by Matthias Krappitz over 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Start date:
2020-05-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
pending-close
Complexity:
Is Regression:
Sprint Focus:

Description

I have a route enhancer for some get parameters of an extbase list view defined, this works, creating urls like /list/page/2/ or /list/company/some-company/:

  JobListPlugin:
    type: Extbase
    limitToPages:
      - 8
    extension: Example
    plugin: Example
    routes:
      -
        routePath: '/page/{page}'
        _controller: 'Job::list'
        _arguments:
          page: '@widget_0/currentPage'
      -
        routePath: '/company/{company}'
        _controller: 'Job::list'
        _arguments:
          company: 'company'
    defaultController: 'Job::list'
    defaults:
      page: '0'
    requirements:
      page: \d+
    aspects:
      page:
        type: StaticRangeMapper
        start: '1'
        end: '200'
      company:
        type: PersistedAliasMapper
        tableName: tx_example_domain_model_company
        routeFieldName: slug

But there is also a search form leading to this list view with additional get parameters not registered in this route enhancer such as:
https://www.example.com/list/?tx_example_example[__referrer][@vendor]=AEMKA&tx_example_example[dosearch]=1&tx_example_example[jobtypes]=&tx_example_example[employmenttypes]=&tx_example_example[sectors]=&tx_example_example[experiences]=&tx_example_example[searchterm]=&tx_example_example[location]=Deutschland&tx_example_example[submit]=Job+jetzt+finden

This also works, but then the f:widget.paginage widget in the list view template creates bogus urls for all the following pagination pages such as here for page 2, as probably the combination of in the route enhancer registered get parameters as the page parameter and the unregistered ones such as tx_example_example[location] and so on, don't go together:
https://www.example.com/list/page/2/?saa1555a4a98208325a88a7bf356923d=AEMKA&tx_example_example__dosearch=1&tx_example_example__jobtypes=&of1a112ff2be8bffb405d448af530174=&tx_example_example__sectors=&bcd51b65fd43035cd742c1e2550214f3=&o9429d49e5dc14c55b027b1d8e5c07a3=&tx_example_example__location=Deutschland&tx_example_example__submit=Job%20jetzt%20finden

This url then leads to an exception obviously beginning with:

(1/1) #1537633463 OutOfRangeException

Hash not resolvable
in /.../typo3_src-9.5.13/typo3/sysext/core/Classes/Routing/Enhancer/VariableProcessor.php line 71

        if (strlen($hash) < 32) {
            return $hash;
        }
        if (!isset($this->hashes[$hash])) {
            throw new \OutOfRangeException(
                'Hash not resolvable',
                1537633463
            );
        }

at TYPO3\CMS\Core\Routing\Enhancer\VariableProcessor->resolveHash('saa1555a4a98208325a88a7bf356923d')

...

It is the same in 9.5.16, to which I can't update in this project because of another route enhancer issue.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #90924: Maximum route parameters always appendedClosed2020-04-01

Actions
Actions #1

Updated by Riccardo De Contardi almost 4 years ago

  • Category set to Site Handling, Site Sets & Routing
Actions #2

Updated by Oliver Hader almost 3 years ago

  • Status changed from New to Needs Feedback
  • Tags set to pending-close

Explanation part:

  • tx_example_example__dosearch is the internal representation of parameter tx_example_example[dosearch]
  • saa1555a4a98208325a88a7bf356923d is the internal representation of tx_example_example[__referrer][@vendor] (which is longer than 32 chars - a limitation in Symfony routes, therefore using an md5 hash as substitute)
  • internal handling happens in VariableProcessor, that's there the exception was thrown

I'm pretty sure this has been addressed with issue #90924 - could you please check whether that still exists in recent TYPO3 versions?
Mentioned change (https://review.typo3.org/c/Packages/TYPO3.CMS/+/65041) was fixed in TYPO3 v9.5.20 - the original report concerned v9.5.16.

Actions #3

Updated by Oliver Hader almost 3 years ago

  • Related to Bug #90924: Maximum route parameters always appended added
Actions #4

Updated by Matthias Krappitz almost 3 years ago

Can confirm this is fixed in 9.5.31

Actions #5

Updated by Oliver Hader almost 3 years ago

  • Status changed from Needs Feedback to Closed

Awesome, thanks for your feedback! :)

Actions

Also available in: Atom PDF