Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpKernel] Circular reference detected for service "templating" #6730

Copy link
Copy link
Closed
@sstok

Description

@sstok
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.