bug #24162 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces (fabpot)

This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces

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

Commits
-------

10204ffe99 [WebProfilerBundle] fixed TemplateManager when using Twig 2 without compat interfaces
This commit is contained in:
Fabien Potencier 2017-09-11 15:35:04 -07:00
commit fc30d5b0cf
1 changed files with 1 additions and 1 deletions

View File

@ -126,7 +126,7 @@ class TemplateManager
}
try {
if ($loader instanceof SourceContextLoaderInterface) {
if ($loader instanceof SourceContextLoaderInterface || method_exists($loader, 'getSourceContext')) {
$loader->getSourceContext($template);
} else {
$loader->getSource($template);