Description
Yesterday I started experimenting with Symfony 2.2-beta, but after running the the tests I got the following error.
Circular reference detected for service "templating", path: "templating -> debug.templating.engine.twig -> twig -> twig.extension.httpkernel -> http_content_renderer -> http_content_renderer.strategy.hinclude".
The only thing on the calling line is this $this->container->get('templating').
Its a functional test that does execute any route, so I guess thats the reason why this was not found earlier.
The problem (from what I have found) is because Twig has the twig.extension.httpkernel which relies on the http_content_renderer which in turn calls the http_content_renderer.strategy.hinclude. And http_content_renderer.strategy.hinclude uses the Templating service causing the Circular reference.
When using the Controller this will not happen because the http_content_renderer 'seems' to be executed before any rendering and preventing the Circular reference from happening.
When I disable the hinclude service (comment <tag />
) it works.
So the only fix I can think of is to pass the Container to the hinclude service and get the templating service when needed (as described in the docs).
Related to #6459