Symfony2 WebProfiler(500):密钥“default”不存在,因为数组在@ Doctrine / Collector / db.html.twig第209行为空

时间:2015-05-16 14:07:48

标签: php symfony doctrine-orm doctrine symfony-sonata

Symfony2 WebProfiler(500):密钥“default”不存在,因为数组在第209行的@ Doctrine / Collector / db.html.twig中为空

我已经在几台机器上安装了Sonata电子商务2.3分支(全新安装)(php 5.4,php 5.5),一切正常,但是在每一个上我在profiler doctrine DB选项卡中都有相同的错误:

Symfony2 WebProfiler (500): Key "default" does not exist as the array is empty in @Doctrine/Collector/db.html.twig at line 209

Profiler仅在第一次请求(缓存为空)后正常工作,在下一个请求之后出现错误。 我在网上搜索解决方案,但没有成功..

提前致谢

1 个答案:

答案 0 :(得分:1)

您可以自己覆盖@ Doctrine / Collector / db.html.twig模板。只需在第209行的新模板中添加条件if collector.mappingErrors[manager] is defined