Actions
Bug #87731
closedExtbasePluginEnhancer requirements ignored
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2019-02-18
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
hello, i’ve tried a little bit arround with the ExtbasePluginEnhancer to get my routes matched. This works in general but if the regex should respect the requirements it fails.
In the ExtbasePluginEnhancer::getVariant() method on line 97 is a piece of code witch should set the requirements, but it always set empty requirements. Because the namespaced variables did not match the compiled variable names.
config:
type: Extbase
limitToPages:
- 103
extension: umantis
plugin: overview
routes:
-
routePath: '/{employmentType}/{jobType}/p{page}'
_controller: 'Overview::filter'
_arguments:
employmentType: jobFilter/employmentType
jobType: jobFilter/jobType
page: pagePointer
-
routePath: '/{employmentType}/{jobType}/{location}'
_controller: 'Overview::filter'
_arguments:
employmentType: jobFilter/employmentType
jobType: jobFilter/jobType
location: jobFilter/location
defaultController: 'Overview::show'
requirements:
employmentType: '^[a-zA-Z \-_]*$'
jobType: '^[a-zA-Z \-_]*$'
location: '^[a-zA-Z \-_]*$'
page: \d+
If we get an route like "/employment/job/p2" the first route should match, if the route is "/employment/job/pitsburg", the second route should match. But because no requirements are set, the first route matched both.
If we use:
$requirements = $this->deflateParameters($route, [$this->namespace => $this->configuration['requirements']]);
to get the requirements its working for me.
Actions