I am trying to set up Symfony with the SonataUserBundle. User registration and login works fine. When I try to call up the /profile view, however I get the following error:
Attempted to call method "setCurrentUri" on class "Knp\Menu\MenuItem" in F:\<my project path>\vendor\sonata-project\user-bundle\Block\ProfileMenuBlockService.php line 91. Did you mean to call: "setCurrent"?
The last notice in the "event list" before the error is
INFO - [cms::renderBlock] block.id=53, block.type=sonata.user.block.menu
Has anyone encountered this error before and can provide information on how to resolve it?
TIA Matt
What versions of
KnpMenuandSonataBlockBundleare you using? Please check yourcomposer.jsonto be sure.The
setCurrentUrimethod has been deprecated as ofKnpMenuv. 2.0, and thecomposer.jsonofSonataBlockBundledoes not requireKnpMenuanywhere but indevinstall. So, this leads to a possibility that you could have required a fresher version ofknplabs/knp-menu-bundlethat is not yet supported by Sonata bundle.Try requiring
knplabs/knp-menu-bundlein1.1.x: