TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Bug on default params with routes (3.3/develop or 3.3/master)
  • Hi, I think I found a bug within the reverse routing with the latest release.

    I've been on the RC for a long time and now it breaks. I've found the the commit that causes it too.

    When I use reverse routing like this:

    $languages_uri = Route::get('api')->uri(array(
            'version'    => 1,
            'controller' => 'languages'
    ));
    

    on the following Route:

    Route::set('api', 'api(/<version>)/<controller>(/<id>)(/<custom>)(/<id2>)(/<custom2>)(/<custom3>)(.<format>)',
        array (
                'version'     => '[0-9]++',
                'id'              => '[0-9;]++',
                'id2'            => '[0-9;]++',
                'custom'     => '[a-z]++',
                'custom2'   => '[a-z]++',
                'custom3'   => '[a-z]++',
        ))
        ->defaults(array(
                'version'    => '1',
                'directory' => 'API',
                'id'              => FALSE,
                'custom'    => FALSE,
                'id2'           => FALSE,
                'custom2'  => FALSE,
                'custom3'  => FALSE,
                'format'     => FALSE,
    ));
    

    On checkout 4d17878d08a6c139c615e19cb47eae7dd78820df on kohana/core I get:

    api/1/languages
    

    Which is correct.

    When I do this on the latest 3.3/develop fb062cfe4f0bae498ab09a383fb5901bd8563528 or 3.3/master f3c027d476b96ad22e238759f23538707f550960 I get:

    api/1/languages/.
    

    Wich is not correct and my project goes into a loop.

    Commit 52fcb825871c77227b8270a0d7c72a2b2b343274 causes it: https://github.com/kohana/core/commit/52fcb825871c77227b8270a0d7c72a2b2b343274

    I'm not sure if this expected behaviour. Apperently it does not filter out dots now and only slashes?

  • I think the core team still prefer issues to be reported and discussed on http://dev.kohanaframework.org rather than here - could you repost this there where they'll get notified?

  • Can't login :( I tried "Lost password" and re-entered my pass on the page the email is linking to, but it won't let me login (username or email). I have to go soon, might try again in some hours. I might also take a more indepth look too in the code when I get home.

  • I've activated your account.

  • man, that's one crazy route! not entirely sure what should be done here but I'll look into it =/

  • Ye I kinda hacked the kohana-api module that's already present on Github. It works but that's enough to say about it. So i'm not suprised you are shocked :-) I think it can be reproduced by a simple route with a dot too.

    @zombor, thanks! I now remember that i couldn't activate some months ago. I forgot about that.

  • if you put together a list of simpler routes that break, I can make sure to add them to our unittests for the future :) in a ticket would be nice!

  • Yes I'm currently at home. Gona clone a clean 3.3 application and try to break the thing!

  • Made some tests in a Minion Task. Bug report @ http://dev.kohanaframework.org/issues/4630

    All OK on 4d17878d08a6c139c615e19cb47eae7dd78820df and some break on fb062cfe4f0bae498ab09a383fb5901bd8563528

  • I also have problems with a simple dummy second controller. If I duplicate the welcome controller and rename it (yes, filename and class name too), I just get a kohana 404 error.

  • sorry, wrong alarm, I had some htaccess issues

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion