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

Also available in: Atom PDF