Ticket #579 (closed defect: fixed)

Opened 14 months ago

Last modified 14 months ago

Routing callback cannot set optional parameters

Reported by: v-dogg Owned by: dominik
Priority: normal Milestone: 0.11
Component: routing Version: 0.11.0RC5
Severity: normal Keywords:
Cc: Patch attached:

Description

routing.xml:

<route name="test" pattern="^(/{test:\d+})?/foo" module="Default" action="Foo" callback="TestCallback" />

callback's onGenerate:

if (!isset($userParameters['test'])) {
  $userParameters['test'] = 'automatic';
}
return true;

Now I would expect $this->context->getRouting()->gen('test'); to generate /automatic/foo but the optional parameter is ignored. HOWEVER if the the isset-test is removed and the optional parameter is given, the callback overwrites it.

Attachments

Change History

Changed 14 months ago by david

  • status changed from new to closed
  • resolution set to fixed

(In [2118]) Fixed problem where routing callbacks could not set optional parameters, closes #579

Add/Change #579 (Routing callback cannot set optional parameters)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.