Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthormerindol


    Here is the router's rule : $Map->connect('/gallery/:year/:tag/:untag', array( 'controller' => 'gallery', 'action' => 'show', 'year' => OPTIONAL, 'tag' => OPTIONAL, 'untag' => OPTIONAL , 'requirements' => array( 'year' => '/2[0-9]{3}/' ) ) ); In the action I trace those GET params : Ak::trace("year : ".$this->params['year']); Ak::trace("tag : ".$this->params['tag']); Ak::trace("untag : ".$this->params['untag']);

    If I go to the "/gallery/2008/something/others" url, I get --->year : 2008 --->tag : something --->untag : others

    If I go to the "/gallery/something/others" url, I get --->year : --->tag : omething --->untag : others

    • Everything is good except for the first letter "s" striped out from the "something" string.
    • Is this a bug?
    • Anyone think of a trick to do the thing?


    • CommentAuthorKaste

    If thats your one and only route then its a bug other than you might think.

    Actually /gallery/something/others should not match the given route, since the OPTIONAL year segment silently behaves as if REQUIRED if another segment follows.

    • CommentAuthormerindol

    Thanks for trying to help me out Kaste.

    It's really weird. I'd really like to know what's the bug (but I currently use a trick for my application to bypass this problem because I can't wait).

    I commented out all router rules but this one, and the bug still occurs. Moreover, both supplied url trigger the router rule : year param is not silently REQUIRED.

    Should I write a trac bug report ? I don't think of any more code to supply than the one in the first post because it's straight from router to controller's action (that traces params), there is no beforeFilter.

    Thanks again

    • CommentAuthorKaste

    The bug is that /gallery/something/others matches this route. or tries to match, sure 'omething' isn't really clever.

    So fixing this bug, you still had to rewrite your routes. If you can write two routes that do what you need. use'em.

    Finally I don't need a bug-ticket (for this), because the issue is already solved in the branches. ;-)

    • CommentAuthormerindol

    Ok thanks Kaste :) I'll fix this on my side.

    Please continue your great work.