-->

Symfony2 WebProfiler (500): Key “default” does not

2019-08-13 05:59发布

问题:

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

I have installed Sonata e-commerce 2.3 branch (fresh installation) on several machines (php 5.4, php 5.5), everything works fine, but and on each one i have the same error in profiler doctrine DB tab:

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

Profiler is working fine only after first request (when cache is empty), after the next request there is the error. I was searching the web for the solution, but without success..

thanks in advance

回答1:

You can override @Doctrine/Collector/db.html.twig template by your own. Just add condition if collector.mappingErrors[manager] is defined in your new template on line 209.