fabpot/Twig-extensions — Issue #31: Attribute "data" does not exist for Node "Twig_Node"
Author: djpate
Created: 2011-10-18 13:53:36+00:00
State: open

With the current version of twig there is a bug using this syntax.

{% set c = "world" %}
{% trans %} hello {{ c }} {% endtrans %}

Stack trace:

PHP Fatal error: Uncaught exception 'Twig_Error_Runtime' with message 'Attribute "data" does not exist for Node "Twig_Node" in "member.html".' in /var/www/.../Kinaf/libs/Twig/lib/Twig/Node.php:142
Stack trace:
#0 /var/www/.../Kinaf/libs/Twig-extensions/lib/Twig/Extensions/Node/Trans.php(121): Twig_Node->getAttribute('data')
#1 /var/www/.../Kinaf/libs/Twig-extensions/lib/Twig/Extensions/Node/Trans.php(34): Twig_Extensions_Node_Trans->compileString(Object(Twig_Node))
#2 /var/www/.../Kinaf/libs/Twig/lib/Twig/Node.php(106): Twig_Extensions_Node_Trans->compile(Object(Twig_Compiler))
#3 /var/www/.../Kinaf/libs/Twig/lib/Twig/Compiler.php(81): Twig_Node->compile(Object(Twig_Compiler))
#4 /var/www/.../Kinaf/libs/Twig/lib/Twig/Node/Block.php(40): Twig_Compiler->subcompile(Object(Twig_Node))
#5 /var/www/.../Kinaf/libs/Twig/lib/Twig/Node.php(106): Twig_Node_Block->compile(Object(Twig_Compiler))
#6 /var/www/.../Kinaf/libs/Twig/lib/Twig/Node.php in /var/www/.../Kinaf/libs/Twig/lib/Twig/Node.php on line 142, referer: http://.../

see https://github.com/fabpot/Twig/issues/470