Skip to content

AbstractController->render errors if templating is disabled #23181

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

Closed
BPScott opened this issue Jun 14, 2017 · 1 comment
Closed

AbstractController->render errors if templating is disabled #23181

BPScott opened this issue Jun 14, 2017 · 1 comment

Comments

@BPScott
Copy link
Contributor

BPScott commented Jun 14, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.2

I have disabled the templating system by not mentioning it in my FrameworkBundle config as I wish to use twig directly (yay perf improvements). I would also like to use the new AbstractController so it is clear what dependencies my controllers have.

However when i try to load a page i get the following error:

(1/1) ServiceNotFoundException
The service "templating.engine.twig" has a dependency on a non-existent service "templating.name_parser".
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 31)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(object(Reference), false)
in AbstractRecursivePass.php (line 57)
at AbstractRecursivePass->processValue(array(object(Reference), object(Reference), object(Reference)), false)
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 35)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(array(object(Reference), object(Reference), object(Reference)))
in AbstractRecursivePass.php (line 64)
at AbstractRecursivePass->processValue(object(Definition), true)
in CheckExceptionOnInvalidReferenceBehaviorPass.php (line 35)
at CheckExceptionOnInvalidReferenceBehaviorPass->processValue(object(Definition), true)
in AbstractRecursivePass.php (line 57)

I think this is due to the AbstractController containing 'templating' => '?'.EngineInterface::class, in its list of subscribed services - when I remove that line my page renders as expected.

@ogizanagi
Copy link
Contributor

See #23186

fabpot added a commit that referenced this issue Jun 15, 2017
…(ogizanagi)

This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Move template.xml loading to a compiler pass

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #23181 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

(failures unrelated)

Commits
-------

6ac0de8 [TwigBundle] Remove template.xml services when templating is disabled
@fabpot fabpot closed this as completed Jun 15, 2017
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

No branches or pull requests

3 participants