Ticket #579 (closed defect: fixed)
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
Note: See
TracTickets for help on using
tickets.

