Project

General

Profile

Bug #91447

Updated by Oliver Hader over 4 years ago

Hi, 

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

 Our example config is: 
 <pre> 
   @    ExampleSimpleEnhancer: 
     type: Simple 
     routePath: '/fuid/{fuid}/fcat/{fcat}' 
     _arguments: 
       fuid: tx_example_pi1/uid 
       fcat: tx_example_pi2/cat 
 </pre> 

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

 Expected data structure: 
 <pre> 
  @ $_GET = array ( 
     'tx_example_pi1' =>  
     array ( 
       'uid' => 123, 
     ), 
     'tx_example_pi2' =>  
     array ( 
       'uid' => 234, 
     ), 
   ); 
 </pre> @ 

 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: 
 <pre> 
         @          // $routeArguments = $this->getVariableProcessor()->inflateParameters($parameters, $route->getArguments()); 
         $routeArguments = $this->getVariableProcessor()->inflateNamespaceParameters($parameters, 'foo', $route->getArguments()); 
 </pre> @ 

 Thanks for investigation and fixing.

Back