【问题标题】:Argument 1 passed to Sonata\PageBundle\Entity\BlockInteractor::__construct() must be an instance of Symfony\Bridge\Doctrine\RegistryInterface传递给 Sonata\PageBundle\Entity\BlockInteractor::__construct() 的参数 1 必须是 Symfony\Bridge\Doctrine\RegistryInterface 的一个实例
【发布时间】:2019-11-25 12:06:20
【问题描述】:

作曲家更新后我得到新的错误

Argument 1 passed to Sonata\PageBundle\Entity\BlockInteractor::__construct() must be an instance of Symfony\Bridge\Doctrine\RegistryInterface, instance of Doctrine\Bundle\DoctrineBundle\Registry given,

symfony 配置

    "sonata-project/admin-bundle": "^3.48",
    "sonata-project/doctrine-orm-admin-bundle": "^3.9",
    "sonata-project/page-bundle": "^3.11",
    "sonata-project/translation-bundle": "^2.4",
    "sonata-project/user-bundle": "^4.3",
    "symfony/console": "4.3.*",
    "symfony/dotenv": "4.3.*",
    "symfony/flex": "^1.1",
    "symfony/framework-bundle": "4.3.*",

【问题讨论】:

    标签: php symfony sonata-admin


    【解决方案1】:

    不确定但尝试扩展 AsbtractController 而不是 Controller 并使用依赖注入,我在 bundle 分页时遇到了类似的问题

     //the use for my example
    use Knp\Component\Pager\PaginatorInterface; 
    
    
    public function recap(Request $request, PaginatorInterface $paginator)
    

    ,也许是这样

    【讨论】:

      【解决方案2】:

      该问题显示何时自动更新学说捆绑(到“版本”:“2.0.2”)

       "doctrine/doctrine-bundle": "1.12.2",
      

      这项工作。

      这里有更多信息https://github.com/symfony/symfony/issues/29810

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-12-06
        • 2018-12-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-05-11
        • 1970-01-01
        相关资源
        最近更新 更多