8000 [2.7] Some parameters are not loaded · Issue #15238 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[2.7] Some parameters are not loaded #15238

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
Azenet opened this issue Jul 8, 2015 · 8 comments
Closed

[2.7] Some parameters are not loaded #15238

Azenet opened this issue Jul 8, 2015 · 8 comments

Comments

@Azenet
Copy link
Azenet commented Jul 8, 2015

Hi,

I used to have (with Symfony 2.6) parameters in app/config/config.yml in this form :

...
parameters:
    my-parameter: 123

I was able to access these using ContainerInterface->getParameter('my-parameter');, however this now throws an InvalidArgumentException with the message "The parameter "my-parameter" must be defined." starting from Symfony 2.7.
There's no trace of this change in the change log nor in the UPGRADE-2.7.md file, is this a bug or is this new behavior intended ?

Thanks.

@javiereguiluz
Copy link
Member

Does the error remain if you use this other config?

# ...
parameters:
   'my-parameter': 123

@Azenet
Copy link
Author
Azenet commented Jul 8, 2015

@javiereguiluz Yes, the error remains.

@xabbuh
Copy link
Member
xabbuh commented Jul 8, 2015

@Azenet Could you fork the the Symfony Standard Edition an make the minimum set of needed changes to reproduce your issue?

@Azenet
Copy link
Author
Azenet commented Jul 8, 2015

@xabbuh
Copy link
Member
xabbuh commented Jul 8, 2015

@Azenet Thank you for providing the fork. I can confirm that this does not work with Symfony 2.7. It even does not work with Symfony 2.6.9.

@xabbuh
Copy link
Member
xabbuh commented Jul 8, 2015

Okay, I had a closer look at this and the "issue" simply is that you define the parameters key twice (the first occurrence is on line 8 when the locale parameter is defined). This is due to a bug with how the Yaml component handled duplicated keys (in contrary to the specs) which was only merged into the 2.5 branch (see #10902). So I'm going to close here.

@xabbuh xabbuh closed this as completed Jul 8, 2015
@xabbuh
Copy link
Member
xabbuh commented Jul 8, 2015

@Azenet
Copy link
Author
Azenet commented Jul 8, 2015

@xabbuh Thanks, I missed this change.

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

3 participants
0