Issue Type: Bug Created: 2012-01-20T21:29:09.000+0000 Last Updated: 2012-01-30T20:37:30.000+0000 Status: Resolved Fix version(s): Reporter: Andrew Moenk (amoenk) Assignee: Ben Scholzen (dasprid) Tags: Related issues: Attachments: - zend-mvc-router-http-part-bug.php
Zend\Mvc\Router\Http\Part::assemble (184) line sets option has_child based on if the route has a name or not, instead of whether the route has children. The has_child option set to true precludes the ability for optional route parameters to be NULL and thus excluded from the assembled route.
Posted by Andrew Moenk (amoenk) on 2012-01-20T21:30:55.000+0000
CLI issue reproduction script. Assumes its place in a project's bin/ directory.
Posted by Andrew Moenk (amoenk) on 2012-01-20T21:32:30.000+0000
diff --git a/library/Zend/Mvc/Router/Http/Part.php b/library/Zend/Mvc/Router/Http/Part.php index 255569f..8a0cfc5 100644 --- a/library/Zend/Mvc/Router/Http/Part.php +++ b/library/Zend/Mvc/Router/Http/Part.php @@ -181,7 +181,7 @@ class Part extends TreeRouteStack implements Route $this->childRoutes = null; }
$options['has_child'] = (isset($options['name']));
$options['has_child'] = ($this->childRoutes !== null);
$path = $this->route->assemble($params, $options); $params = array_diff_key($params, array_flip($this->route->getAssembledParams()));
Have you found an issue?
See the Overview section for more details.