-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Move template.xml loading to a compiler pass #23186
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
Conversation
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!interface_exists(EngineInterface::class) || !$container->hasAlias('templating')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've kept the interface_exists
check as a safe guard, in case another templating
alias exists in userland/third party bundle (probably unlikely, but still).
We could also get the framework configuration and process it back to get the $config['templating']['enabled]
value, but not sure it's worth it.
Oh. Actually, it fixes a bug in 3.3 with the |
If framework.templating is disabled and the |
Problem is that we must ensure the TwigBundle TemplatingPass is executed before the FrameworkBundle one, hence using the 3.2 compiler pass priority feature. So we'll need to act differently for lower branches: instead of differing the loading of the For now, rebased on 3.2 at least. |
Re-targeted to 2.7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Maybe a test/comment would be good to prevent regressions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you @ogizanagi. |
…(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
(failures unrelated)