Bug #91323
closedRoute enhancer kills unregistered get parameters
0%
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.