【问题标题】:Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct()参数 3 传递给 Sonata\Twig\Extension\TemplateExtension::__construct()
【发布时间】:2019-05-16 04:30:25
【问题描述】:

自从从 4.1.8 更新到 Symfony 4.2 后,我不断收到以下错误:

 22:00:39 CRITICAL  [php] Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct() must be an instance of Sonata\CoreBundle\Model\Adapter\AdapterInterface, instance of Sonata\Doctrine\Adapter\AdapterChain given, called in /home/kostya/projects/php/www/hillel/sf_store/var/cache/dev/ContainerOrMv7ZL/srcApp_KernelDevDebugContainer.php on line 1265 ["exception" => Symfony\Component\Debug\Exception\FatalThrowableError { …}]
!!  
!!  In TemplateExtension.php line 40:
!!                                                                                 
!!    Argument 3 passed to Sonata\Twig\Extension\TemplateExtension::__construct()  
!!     must be an instance of Sonata\CoreBundle\Model\Adapter\AdapterInterface, i  
!!    nstance of Sonata\Doctrine\Adapter\AdapterChain given, called in /home/kost  
!!    ya/projects/php/www/hillel/sf_store/var/cache/dev/ContainerOrMv7ZL/srcApp_K  
!!    ernelDevDebugContainer.php on line 1265

有人知道如何解决吗?

【问题讨论】:

  • 接口期望类为参数 3 接收什么? (Sonata\CoreBundle\Model\Adapter\AdapterInterface) 字符串、整数、数组、对象、布尔值等。
  • 我认为这是更新 symfony 时的错误。我也面临这个问题。但还没有解决。该错误可能在 sonata-project/core-bundle (3.13.2)

标签: php symfony sonata twig-extension


【解决方案1】:

更新奏鸣曲项目/教义扩展(1.1.2 => 1.1.3): 正在下载 (100%) 更新奏鸣曲项目/核心捆绑包 (3.13.2 => 3.13.4): 下载 (100%)

是的,他们今天修好了!!谢谢。

【讨论】:

  • 你能进一步解释你做了什么让它再次工作吗?
【解决方案2】:

它是 sonata-project/core-bundle (3.13.2) 中的一个错误

检查这个 GIT:https://github.com/sonata-project/SonataCoreBundle/issues/613

【讨论】:

  • @Bsquare 这是一个有效的答案。注意这是一个已知的错误并提供错误报告的链接是有帮助的。无需再添加任何内容。如需进一步指导,请参阅 this meta answer
  • 好的,我明白了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-12-08
  • 2021-12-10
  • 2020-01-13
  • 2013-02-22
  • 2020-01-28
  • 1970-01-01
  • 2018-12-19
相关资源
最近更新 更多