[#8125] Empty id causes missing url part when generating a url in routes
Summary Empty id causes missing url part when generating a url in routes
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Assigned
Priority 1. Low
Owners chuck@horde.org
Requester wrobel@horde.org
Created 2009-03-27 (3859 days ago)
Due
Updated 2010-10-10 (3297 days ago)
Assigned 2009-03-27 (3859 days ago)
Resolved
Milestone
Patch No

Comments
Gunnar Wrobel <wrobel@horde.org> 2009-03-27 19:51:34
When using a route such as



  $m->connect(':controller/:action/:id', array('controller' => 
'content', 'action' => 'view', 'id' => 'all'));



or



  $m->connect(':controller/:action/:id', array('controller' => 
'content', 'action' => 'view'));



the call



$m->generate(array('controller' => 'content', 'action' => 'view', 'id' => 0))



returns an unexpected result.



I added a unit test and a potential fix. I think the fix improves 
things but it has an effect on the outcome of other unit tests. So I 
guess I better attach this as a patch.

Gunnar Wrobel <wrobel@horde.org> 2009-03-27 20:02:08
Hit another thing the other way around when mapping urls. Empty ids 
cause selection of the default if one is given. If no default is 
present the mapping works fine. I just add the failing unit test for 
this.