Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Twig] autoescape_service option stops container from being dumped #13467

Closed
wants to merge 1 commit into from

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented Jan 20, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets n/a
License MIT
Doc PR n/a

If the twig.autoescape_service option is set from then the container cannot be dumped.

I haven't been able to nail down why this is the case, but I have added to the test to show this happening. In a symfony project this means this error is shown when trying to run the console:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
You cannot dump a container with parameters that contain references to other services (reference to service "my_project.some_bundle.template_escaping_guesser" found in "/twig.options/autoescape/0").

@fabpot
Copy link
Member

fabpot commented Jan 21, 2015

@mcfedr Can you check that #13476 fixes this issue?

@fabpot fabpot closed this Jan 21, 2015
@mcfedr
Copy link
Contributor Author

mcfedr commented Jan 21, 2015

@fabpot Seems to fix the issue

fabpot added a commit that referenced this pull request Jan 30, 2015
…it cannot contain service references) (fabpot)

This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] fixed Twig options (removed the parameter as it cannot contain service references)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #13467
| License       | MIT
| Doc PR        | n/a

The new `autoescape_service` option is used to set the `autoescape` Twig option, which can be a callable. The Twig options are stored in a parameter (`twig.options`), but as parameters cannot have references, that does not work well.

So, this PR removed the parameter as it is not needed.

Commits
-------

69748a1 [TwigBundle] fixed Twig options (removed the parameter as it cannot contain service references)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants