Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Removed calls to Twig\Environment::loadTemplate()#33273
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheCacheWarmer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
| if (!$themeinstanceof Template) { | ||
| /* @var Template $theme */ | ||
| $theme =$this->environment->loadTemplate($theme); | ||
| $theme =$this->environment->load($theme)->unwrap(); |
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.
@fabpot the reason why we need to unwrap here is that we rely on the internalgetBlocks function of the Template class. We don't only want to use the block names, so the non-internalgetBlockNames is not enough for us (we are also relying on the internaldisplayBlock signature which has more arguments)
src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedAug 21, 2019
@stof is right, I read too fast. We should avoid to |
stof commentedAug 21, 2019
the only place needing to unwrap is the form renderer engine, because it relies on internal Twig APIs to manipulate blocks (which is bad news, as there is no BC guarantee for them) |
2fcb90e tob792255Compareb792255 toea9e375Comparesrc/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
derrabus commentedAug 21, 2019
I can't do much about the unwrapping in Status: needs review |
derrabus commentedAug 21, 2019
CI failure seems to be an internal hiccup at Travis. |
fabpot commentedAug 21, 2019
Thank you@derrabus. |
This PR was merged into the 4.4 branch.Discussion----------Removed calls to Twig\Environment::loadTemplate()| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | N/A| License | MIT| Doc PR | N/AThis PR prepares#33039. Twig 3 does not have the `loadTemplate()` anymore, so this PR replaces calls to that method.Commits-------ea9e375 Removed calls to Twig\Environment::loadTemplate().
This PR prepares#33039. Twig 3 does not have the
loadTemplate()anymore, so this PR replaces calls to that method.