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

Deprecation Message in knp-menu-bundle/src/Provider/BuilderAliasProvider.php:104 #373

Open
Gemineye opened this issue Dec 8, 2017 · 2 comments

Comments

@Gemineye
Copy link

Gemineye commented Dec 8, 2017

I see this Message after rendering a menu:

User Deprecated: Passing "false" as the second argument to Symfony\Component\HttpKernel\Kernel::getBundle() is deprecated as of 3.4 and will be removed in 4.0.

@stof
Copy link
Collaborator

stof commented Dec 8, 2017

We cannot easily avoid this deprecation warning without breaking support for bundle inheritance. I don't have an idea yet to avoid triggering it in case inheritance is not used (I'm not even sure it is possible).

Our code is already compatible with newer versions not supporting this attribute though.

@slunak
Copy link

slunak commented May 24, 2018

I was getting the same depreciation notice in 3.4 and was able to get rid of it. I was calling the menus in views using the following:

{{ knp_menu_render('AppBundle:Builder:dashboardAccountMenu', {'template': ':menu:menu.html.twig'}) }}

The Builder class was not registered as a Service. Following the documentation I registered MenuBuilder as a Service:

Creating Menu Builders as Services

And now calling menus as following (using menu alias):

{{ knp_menu_render('dashboard_account_menu', {'template': ':menu:menu.html.twig'}) }}

Hope this can help someone.

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