Bug #87731
closedExtbasePluginEnhancer requirements ignored
0%
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.
Updated by Anja Leichsenring over 5 years ago
- Related to Task #88686: Fix requirements in parameter added
Updated by Gerrit Code Review over 5 years ago
- Status changed from New to Under Review
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61225
Updated by Gerrit Code Review over 5 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61225
Updated by Gerrit Code Review over 5 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61225
Updated by Oliver Hader almost 5 years ago
Using deflateKeys
on route requirements is indeed missing here. For "flat" arguments like "another_value" it would have been fine, for nested arguments like "another/value" it just did not work.
Please continue in issue #86895 and test & vote on these patches which focus on route defaults and requirements:
https://review.typo3.org/q/Ia260e407dcc657a2e7c85628da9e001d94952c37
Updated by Oliver Hader almost 5 years ago
- Status changed from Under Review to Closed
Updated by Oliver Hader almost 5 years ago
- Related to Bug #86895: routeEnhancer not working correct for paginate widget added