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

Fix non-existent parameter #5963

Merged
merged 1 commit into from
Mar 17, 2020
Merged

Conversation

franmomu
Copy link
Member

@franmomu franmomu commented Mar 16, 2020

Subject

In AbstractSonataAdminExtension I added this line:

$useIntlTemplates = $container->getParameter('sonata.admin.configuration.use_intl_templates');

This is class is extended in other bundles, so the problem is that depending on the order of how the bundles are registered works or not (if the AdminBundle is registered first works).

I am targeting this branch, because this is a patch.

Closes #5961

Changelog

### Fixed
- Accessing to a non-existing parameter when extending `AbstractSonataAdminExtension`

I only could come up with this solution, any other way/help is appreciated. I can't take a further look until this evening/night.

@phansys phansys added the patch label Mar 17, 2020
@franmomu franmomu force-pushed the fix_is_parameter branch 2 times, most recently from 8f60920 to 1300236 Compare March 17, 2020 07:55
@franmomu franmomu marked this pull request as ready for review March 17, 2020 08:08
@greg0ire
Copy link
Contributor

This is what I've done so far, I thought it could be solved with the prepend method, but looks like it doesn't work as I expected, I'll try more things tomorrow.

That's what I would have tried too

@franmomu franmomu force-pushed the fix_is_parameter branch 2 times, most recently from 4d4953e to 647b2db Compare March 17, 2020 13:16
@franmomu
Copy link
Member Author

This is what I've done so far, I thought it could be solved with the prepend method, but looks like it doesn't work as I expected, I'll try more things tomorrow.

That's what I would have tried too

We were in the right path I think, but looks like this line is not loading properly the configuration inside the prepend, I don't know if this is related to this issue or maybe I was doing something wrong in the test. So I changed the test in another way and also created another for the AbstractSonataAdminExtension.

greg0ire
greg0ire previously approved these changes Mar 17, 2020
@greg0ire
Copy link
Contributor

@dmaicher can you please test the fix? @franmomu you may use this script to provide instructions: https://gist.github.com/greg0ire/a404831add1247d2bc20fa11107c5d5e

@franmomu
Copy link
Member Author

@dmaicher can you please test the fix? @franmomu you may use this script to provide instructions: https://gist.github.com/greg0ire/a404831add1247d2bc20fa11107c5d5e

nice!

composer config repositories.franmomu vcs https://github.com/franmomu/SonataAdminBundle
composer require sonata-project/admin-bundle "dev-fix_is_parameter as 3.62.0"

I'm going to extract the test I added to a class.

@franmomu franmomu force-pushed the fix_is_parameter branch 3 times, most recently from 9e78864 to 050e208 Compare March 17, 2020 19:14
@dmaicher
Copy link
Contributor

@franmomu @greg0ire it works fine for me without any other changes (bundle order same as before) 👍

@greg0ire greg0ire requested a review from a team March 17, 2020 20:19
@franmomu
Copy link
Member Author

@franmomu @greg0ire it works fine for me without any other changes (bundle order same as before) 👍

Thanks for checking @dmaicher !

@greg0ire greg0ire merged commit f0bd956 into sonata-project:3.x Mar 17, 2020
@greg0ire
Copy link
Contributor

Thanks @franmomu , I'm releasing this!

@franmomu franmomu deleted the fix_is_parameter branch March 18, 2020 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You have requested a non-existent parameter "sonata.admin.configuration.use_intl_templates".
5 participants