We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Routing issues after update from 2.0.10 to 2.0.11

Hello,

I have a multi module project with routes setup which worked until yesterday after I updated phalcon.

Here's a sample route that I worked:

$router->add('/locations/:controller/:action/(\d+)/',[
    'module' => 'locations',
    'namespace' => 'Locations\controllers',
    'controller' => 1,
    'action' => 2,
    'id' => 3
]);

This worked for https://example.com/locations/poi-translations/index/1/ , now I get this error:

[message:protected] => Locations\controllers\Poi-translationsController handler class cannot be loaded
[string:Exception:private] => 
[code:protected] => 2
[file:protected] => /var/www/example.com/public/index.php
[line:protected] => 5
[trace:Exception:private] => Array
    (
        [0] => Array
            (
                [function] => _throwDispatchException
                [class] => Phalcon\Mvc\Dispatcher
                [type] => ->
                [args] => Array
                    (
                        [0] => Locations\controllers\Poi-translationsController handler class cannot be loaded
                        [1] => 2
                    )

            )

If I rename class and file to something that doesn't use camelcase and adjust the route accordingly, it works just fine, and I notice this problem on an older project that works fine in production on 2.0.10 but it doesnt work on local server on 2.0.11.

I wasn't able to find a solution for this, also form changelog I couldn't see anything that might affect routing. Any pointers would be much appreciated.

Thanks!



85.5k

there were some changes in zephir repo regarding this.

more info here: https://github.com/phalcon/zephir/pull/1253

eather wait for next realse or use older commit of zephir to rebuild master branch of phalcon repo.

I have a same problem now. And I can't find a way to install previous version for ubuntu.



85.5k
git clone phalcon
cd cphalcon
git checkout cf3c1fe62184d36d24c543c0b4f9993ea8f2445b

./install ?

Thank you for a fast answer!

After typing my question I found a link to a .deb of 2.0.10 for Ubuntu 14.04 : https://launchpad.net/~phalcon/+archive/ubuntu/stable/+build/8984797 . Everything works again.



85.5k

there is 2.0.12 now btw which should be fine

edited May '16

I have similar issue with both v2.0.11 and now v2.0.12, which is not present in v2.0.10.

Getting RuntimeException:

RuntimeException Object
(
    [message:protected] => Trying to call method send on a non-object
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /fullpath/site/public/index.php
    [line:protected] => 59
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [function] => sendHeaders
                    [class] => Phalcon\Http\Response
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [1] => Array
                (
                    [file] => /fullpath/site/public/index.php
                    [line] => 59
                    [function] => handle
                    [class] => Phalcon\Mvc\Application
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

        )

    [previous:Exception:private] => 
)

This method fails:

$application = new \Phalcon\Mvc\Application($di);
$application->handle();

The code above is working fine with Phalcon 2.0.10 and below.



85.5k

they forgot to rebuild with zephir so wait for 2.0.13 which should be up very soon i guess

On my Micro app both 2.0.11 and 2.0.12 versions are working fine. It's just on big bad ass full MVC app where I had need to override Response object this can go wrong.