Closed schauer closed 8 years ago
Thanks for reporting, will look into it.
@aleksip -
Is there any way to temporarily work around this? I rely on embed
pretty heavily.
@TxHawks
Replacing in the file IncludeNodeVisitor the line 16
if ($node instanceof \Twig_Node_Include) {
with if ($node instanceof \Twig_Node_Include && !($node instanceof \Twig_Node_Embed)) {
can be a temporarily solution,
@schauer @TxHawks Working on this right now, hope to have a solution ready today!
Thank you, I did not want to rush you.
@schauer @TxHawks Just created a pull request containing a fix for this issue. At least it worked for me. Would be great if you could test it too.
@aleksip Looks good to me. I have tested it, and it worked both, include and embed. Thanks!
Works here as well
@schauer @TxHawks Thanks for testing!
@dmolsen Thanks for merging!
v0.7.1
is now out on Packagist.
The commit https://github.com/pattern-lab/patternengine-php-twig/commit/b5ed124547944abc7a0d5ad70be2523b60c63934 prevents using the Tag embed. The Solution is to add another Node Visitor EmbedNodeVisitor which creates an PatternDataEmbedNode exending _Twig_NodeEmbed. In Addition prevent in the IncludeNodeVisitor creating a PatternDataIncludeNode class in case the $node is an object of _Twig_NodeEmbed. Something like
if ($node instanceof \Twig_Node_Include && !($node instanceof \Twig_Node_Embed)) {