Thanks to visit codestin.com
Credit goes to github.com

Skip to content

console config:debug seems broken when using "%kernel.debug%" or any other boolean parameter #11622

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

Closed
migueleliasweb opened this issue Aug 8, 2014 · 1 comment

Comments

@migueleliasweb
Copy link

The command "console config:debug" seems broken.

If you try to debug a bundle configuration of a bundle that has a boolean %parameter%, the following exception will be thrown.

This happens (as of now) with AsseticBundle and DoctrineBundle.

screenshot from 2014-08-08 13 52 04
screenshot from 2014-08-08 13 52 18

I used the following configurations:
screenshot from 2014-08-08 14 07 44
screenshot from 2014-08-08 14 07 31

I searched for this error, but it does not seems to be reported (yet).

@migueleliasweb
Copy link
Author

After some debugging, I found that the ConfigDebugCommand validates the configuration before resolving the %parameters%, so when the field for ex: "auto_generate_proxy_classes" is validated, it's value is still %kernel.debug% instead of true and them, the exception is thrown =/

I don't know if the validation before the parameters resolution is a desired code flow, if it's not, both should be switched IMHO.

ConfigDebugCommand.php Line 81
screenshot from 2014-08-08 14 16 35

fabpot added a commit that referenced this issue Aug 11, 2014
…e processed in the config:debug command (xabbuh)

This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] resolve parameters before the configs are processed in the config:debug command

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11622
| License       | MIT
| Doc PR        |

If the raw values are passed to the processor, config values don't necessarily have the expected data type. For example, the value of the kernel.debug parameter is a boolean type. But when passed as the raw parameter name, it is a string.

@lyrixx Do you have any objections?

Commits
-------

19f3b47 resolve parameters before the configs are processed
@fabpot fabpot closed this as completed Aug 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants