Closed secit-pl closed 7 years ago
To make the bundle compatible with Twig 2.0 one need to copy the current TwigFileVisitor and create a new Twig20FileVisitor with "pretty much" the same logic but using the new updated interface. One would also need a function to determine what TwigFileVistor to use.
If one could make a PR that I can merge in a minor release I would happily review that PR.
FYI @andrerom
Thanks for the heads up, this is somewhat duplicate of #422 right?
Well, it prevents the fatal error while Twig 2.0 ain't usable, @Nyholm. It has to do with it, but doesn't fix 2.0, that's right.
Okey, you are correct. Thanks
@Nyholm: But with fixes in #422 it might be enough to run with twig 2.0 as 2.0 has the same functionality as latest 1.x versions just with deprecated functionality removed and AFAIR it is forward compatible.
Most things, yes. But not all. The interface for the file visitor has changed.
I don't get it. Apart from the tests that the author of #422 said are already falling on master and the comment I left there everything seems to pass
I'm on it. The extractor is running here. I'll open a PR momentarily.
Hello,
any news for this ?
Thanks !
any news for this ?
@skonsoft PR is stalled and could get some help on solving it differently.
Had a crack at updating for Twig 2.0 here #432:
Its working on local machine, (Symfony3.2.4, PHP 7.1.1) but I can't figure out how to resolve the build errors originating from BC problems around the use Twig_Node instead of expected Twig_NodeInterface.
Best of luck.
Mark
Hi,
any update on this?
Hi, It worked fine on local, but I ran into this error once on my production server.
Unfortunately, I can't downgrade twig since I need it's latest version...
How far are you in fixing this issue ?
Thank you
I'm also looking forward to this fix, guys.
Thank you in advance.
Hello again,
I think it become difficult to continue using this bundle. I hope that we have a new version that can fix this serious problem.
Thanks.
Like I said, Im happy to merge a Twig 2.0 PR. But it has to be properly made and pass the tests.
I can also let you know that php-translation supports twig 2.0.
@Nyholm Thank you. I hope that it will be fixed soon. I used your commit until we have a new release fixing this issue.
Thanx
Any news on this?
Status: Waiting for someone to contribute a clean fix that works on both Twig 1 and Twig 2.
Please don't comment on this issue unless it's a status update, or if you want to contribute fix on it and want to coordinate.
This bundle is not compatible with Twig 2.0.
PHP Fatal error: Declaration of JMS\TranslationBundle\Twig\NormalizingNodeVisitor::enterNode(Twig_NodeInterface $node, Twig_Environment $env) must be compatible with Twig_NodeVisitorInterface::enterNode(Twig_Node $node, Twig_Environment $env) in /home/devsyssim/src/vendor/jms/translation-bundle/JMS/TranslationBundle/Twig/NormalizingNodeVisitor.php on #line 29 [2017-01-09 13:56:12] php.CRITICAL: Fatal Compile Error: Declaration of JMS\TranslationBundle\Twig\NormalizingNodeVisitor::enterNode(Twig_NodeInterface $node, Twig_Environment $env) must be compatible with Twig_NodeVisitorInterface::enterNode(Twig_Node $node, Twig_Environment $env) {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 0): Compile Error: Declaration of JMS\TranslationBundle\Twig\NormalizingNodeVisitor::enterNode(Twig_NodeInterface $node, Twig_Environment $env) must be compatible with Twig_NodeVisitorInterface::enterNode(Twig_Node $node, Twig_Environment $env) at /home/devsyssim/src/vendor/jms/translation-bundle/JMS/TranslationBundle/Twig/NormalizingNodeVisitor.php:29)"}
[Symfony\Component\Debug\Exception\FatalErrorException]
Compile Error: Declaration of JMS\TranslationBundle\Twig\NormalizingNodeVis
itor::enterNode(Twig_NodeInterface $node, Twig_Environment $env) must be co
mpatible with Twig_NodeVisitorInterface::enterNode(Twig_Node $node, Twig_En
vironment $env)