Project

General

Profile

Actions

Bug #87731

closed

ExtbasePluginEnhancer requirements ignored

Added by Kalle Karlson about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & 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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #88686: Fix requirements in parameterClosed2019-07-04

Actions
Related to TYPO3 Core - Bug #86895: routeEnhancer not working correct for paginate widgetClosed2018-11-09

Actions
Actions #1

Updated by Anja Leichsenring almost 5 years ago

  • Related to Task #88686: Fix requirements in parameter added
Actions #2

Updated by Gerrit Code Review almost 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

Actions #3

Updated by Gerrit Code Review almost 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

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Oliver Hader over 4 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

Actions #6

Updated by Oliver Hader over 4 years ago

  • Status changed from Under Review to Closed
Actions #7

Updated by Oliver Hader over 4 years ago

  • Related to Bug #86895: routeEnhancer not working correct for paginate widget added
Actions

Also available in: Atom PDF