This test case reproduces the issue reported by @stof in fabfot/Twig#958. This
problem is being caused by the fact that the {% embed %} tag causes the
generation of a separate template class sharing the exact same
$this->templateName value as the main template containing the tag. This then
confuses Twig_Error::guessTemplateInfo when it's iterating through the
$backtrace comparing $this->filename to $trace['object']->getTemplateName().
This commit is contained in:
Henry Smith
2013-07-16 22:08:51 +01:00
parent c35d7f267f
commit e225f8e2dd
@@ -0,0 +1,16 @@
--TEST--
"embed" tag
--TEMPLATE(index.twig)--
FOO
{% embed "foo.twig" %}
{% block c1 %}
{{ nothing }}
{% endblock %}
{% endembed %}
BAR
--TEMPLATE(foo.twig)--
{% block c1 %}{% endblock %}
--DATA--
return array()
--EXCEPTION--
Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5