Project

General

Profile

Actions

Bug #91447

closed

SimpleEnhancer don't inflate nested arguments

Added by Stefan Berger about 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2020-05-20
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,

we try to use the SimpleEnhancer to replace speaking urls into GET parameters.

Our example config is:

  ExampleSimpleEnhancer:
    type: Simple
    routePath: '/fuid/{fuid}/fcat/{fcat}'
    _arguments:
      fuid: tx_example_pi1/uid
      fcat: tx_example_pi2/cat

We found out, that the defined arguments don't be inflated in to the nested structure of the target GET parameters.

Expected data structure:

 $_GET = array (
    'tx_example_pi1' => 
    array (
      'uid' => 123,
    ),
    'tx_example_pi2' => 
    array (
      'uid' => 234,
    ),
  );

By the way the PluginEnhancer does that, but all under one defined namespace and not in different data structures.

Debuggings in the SimpleEnhancer with the PluginEnhancer in mind, lead us to behavior, when we use in SimpleEnhancer::buildResult the method VariableProcessor::inflateNamespaceParameters with a fake namespace for inflating the $routeArguments, then the result will be expected.

This fix our problem in SimpleEnhancer::buildResult:

        // $routeArguments = $this->getVariableProcessor()->inflateParameters($parameters, $route->getArguments());
        $routeArguments = $this->getVariableProcessor()->inflateNamespaceParameters($parameters, 'foo', $route->getArguments());

Thanks for investigation and fixing.


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #95512: Routing: SimpleEnhancer stopped working with 9.5.31Closed2021-10-07

Actions
Related to TYPO3 Core - Bug #95662: DOCS: SimpleRouteEnhancer adds cHashAccepted2021-10-15

Actions
Actions

Also available in: Atom PDF