It does not match this in the chain class due to checking of the separator to ensure it matches what was set internally. The problem is since it's optional, the separator doesn't exist to check it with the array....

At first glance, adding "$separator !== false &&" to the if statement seems to fix it, but I have not run the unit tests.

Comments

Posted by Alexander Mazalov (alex347) on 2009-09-29T07:15:57.000+0000

I have the same problem, but I think the soultion must be something like this:
1) add this line before if statement
if ($separator === false) $separator='';
or
2) remove line: $path = trim($request->getPathInfo(), '/');

I have the same problem, but I think the soultion must be something like this:
1) add this line before if statement
if ($separator === false) $separator='';
or
2) remove line: $path = trim($request->getPathInfo(), '/');

then it works for my case:
I'm using urls like
/search/query/
/search/query/page3.html

This is exactly the same problem I have reported in bug ZF-9030 only that deals with a module router at the end. But the problem remains... While creating the patch reported in that bug I actually never realised the problem also occurs with 'normal' optional parameters.

Posted by Kim Blomqvist (kblomqvist) on 2010-10-21T10:20:59.000+0000

I would have assumed this issue to be solved along ZF-7848, ZF-8812 and ZF-9030, but there is still something wrong with matching to the default value. I wrote these two unit test (attachment) which of the first one does not pass:

I'll look at this for the 1.11.1 release. Thanks for the unit tests -- those definitely help better isolate the issue!

Posted by Kim Blomqvist (kblomqvist) on 2011-01-22T01:08:42.000+0000

I have located the issue. The attached patch includes both the fix and the tests. I suggest that the maintainer of this component or the reviewer would check the patch if they came up with more elegant solution.

Posted by Ben Scholzen (dasprid) on 2011-02-16T07:04:09.000+0000

Patch accepted, but I have no time right now to merge it, can somebody else take that part?