Call to method setCurrentUri fails in Symfony/SonataUserBundle setup

后端 未结 3 998
南笙
南笙 2021-01-17 18:26

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 foll

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-17 19:16

    What versions of KnpMenu and SonataBlockBundle are you using? Please check your composer.json to be sure.

    The setCurrentUri method has been deprecated as of KnpMenu v. 2.0, and the composer.json of SonataBlockBundle does not require KnpMenu anywhere but in dev install. So, this leads to a possibility that you could have required a fresher version of knplabs/knp-menu-bundle that is not yet supported by Sonata bundle.

    Try requiring knplabs/knp-menu-bundle in 1.1.x:

    {
        ...
        "require": {
            "knplabs/knp-menu-bundle": "~1.1"
        },
        ...
    }
    

提交回复
热议问题