Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatcher's params override any setVar() #13121

Closed
dugwood opened this issue Oct 18, 2017 · 1 comment
Closed

Dispatcher's params override any setVar() #13121

dugwood opened this issue Oct 18, 2017 · 1 comment
Labels
bug A bug report status: medium Medium

Comments

@dugwood
Copy link
Contributor

dugwood commented Oct 18, 2017

Expected and Actual Behavior

#13046 introduce a fix and a breaking change: params are now send to setVars(), erasing previously set variables. Works great, but:
https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/application.zep#L351
=> injects dispatcher's params, and erase previously set variables in controllers.

Before 3.2.3

Url: /test-page/1234

$router->add('/test-page/{bar:[0-9]+}', ['controller' => 'MyController', 'action' => 'test']);

in MyController::testAction():

$this->view->setVar('bar', 'foo');

in test.volt:

{{ bar }}

Returns:

foo

After 3.2.3

Returns:

1234

Details

  • Phalcon version: 3.2.3
  • PHP Version: 7.0
  • Operating System: Linux
  • Installation type: package from packagecloud.io
  • Server: Other
@sergeyklay
Copy link
Member

Fixed in the latest stable version. Feel free to open a new issue if the problem appears again. Thank you for contributing, and for helping us make Phalcon better.

@sergeyklay sergeyklay removed the Volt label Oct 21, 2017
chilimatic pushed a commit to chilimatic/cphalcon that referenced this issue Nov 2, 2017
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

3 participants