-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: Undefined variable $_v0 since 3.15 #4480
Comments
Duplicate of #4452? |
Does #4475 help? |
Yes, #4452 has the exact same error in one of the comments, the issue title was not meaningful for my use case sorry ! |
for that you probably need symfony/symfony#58964 (i.e. the latest patch release of |
I'm currently on 7.2 RC1, I'll wait the next RC to update Twig then |
Closing as this has been fixed already as mentioned above. |
@fabpot, the issue is still actual. |
@alexndlm Please create a small application then that allows to reproduce it. |
For now, I cannot create the Tets app. Could you please check this https://github.com/EasyCorp/EasyAdminBundle/actions/runs/12086509610/job/33705948788 The interesting thing is that for |
That job installs version 7.1.0 of the Twig bridge which is probably the reason for the failure. |
Got it, thanks. And what about job with 6.4 - https://github.com/EasyCorp/EasyAdminBundle/actions/runs/12086509610/job/33705948476 |
Ohhhhhh. Got it. In that job exactly 6.4.0 |
@alexndlm the jobs is asking for it: https://github.com/EasyCorp/EasyAdminBundle/actions/runs/12086509610/job/33705948476#step:6:1
|
Thanks. I finally got it. |
@xabbuh after updating to the latest versions of all Symfony packages, I still see I prepared the smallest possible reproducer:
You'll see this exception:
Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Warning: Undefined variable $_v0").
at vendor/easycorp/easyadmin-bundle/templates/crud/index.html.twig:40 |
@javiereguiluz Can you check that you have version 3.16.0? |
The Note that I am using the latest Twig and |
@fabpot I made several tests:
EA 4.16.0 introduced Twig Components; that's why I also test 4.15.1. I did another test: EA 4.18 + SF 7.2 works if I downgrade Twig to 3.14.2. The first version that doesn't work is Twig 3.15.0. |
I am looking into it. |
Twig 3.15+ breaks EasyAdmin for some unknown reasons. Let's stick on 3.14 until EasyAdmin has fixed up their problem. EasyCorp/EasyAdminBundle#6605 twigphp/Twig#4480
This closure was not fixed as mentioned above. |
Be prepared for the "acceptable breaking change" excuse. |
This comment was marked as resolved.
This comment was marked as resolved.
Please, be respectful. This comment is inappropriate, even more so as @xabbuh commented that he was looking at it. |
How is that inappropriate? It is exactly the excuse that your team used about another closed issue. Is this is inappropriate here, it was also inappropriate when your team used it. Also note that this issue is still closed. If someone was looking at it, it would have been reopened. |
Why isn't it reopen? I don't use EasyAdmin and I have the same problem. |
It is still present |
@q1t1 Can you create a small example application that allows to reproduce your issue then please? |
@xabbuh yes, your change fixed the issue to me 🎉 Now I have SF 7.2.0 + Twig 3.16.0 + EA 4.18.0 and it's working 🙌 Thanks a lot 🙇 |
Unfortunately, not at this time... But I have SF 7.2.0 + Twig 3.16.0 + EA 4.18.0 too, and it doesn't work |
In addition to the reproducer app, I just tested this on a real and complex Symfony app that was failing too, and the changes proposed by Christian fixed it too. @q1t1 probably you did, but make sure to run |
Mine issue also gone for SF 7.2.0 + Twig 3.16.0 + EA 4.18.0. Thanks |
Fix works for me with SF 7.2.0, Twig 3.16.0, EA 4.18.0 |
SF 7.2.0, Twig 3.15.0 / 3.16.0, EasyAdmin 4.18.0 - fix works |
I managed to get it to work, thank you ! |
Thank you all for confirming. |
This PR was merged into the 7.2 branch. Discussion ---------- [TwigBridge] generate conflict-free variable names | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #58706 (comment), Fix EasyCorp/EasyAdminBundle#6605, Fix twigphp/Twig#4480 | License | MIT Commits ------- 1a38aca generate conflict-free variable names
This PR was merged into the 7.2 branch. Discussion ---------- [TwigBridge] generate conflict-free variable names | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony/symfony#58706 (comment), Fix EasyCorp/EasyAdminBundle#6605, Fix twigphp/Twig#4480 | License | MIT Commits ------- 1a38acac24 generate conflict-free variable names
@pan93412 done |
Works on symfony/twig-bridge@1343696, 57bf519, and EasyCorp/EasyAdminBundle@2307da5. Thanks! |
I know. I have already adapted my project to 7.3-DEV. |
Unfortunately, this is still happening. Even with Symonfy 7.2 + EA 4.18 + Twig 3.16. The only fix here is to go back to |
@ServerExe are you using the 7.2.x-dev version of Symfony or a stable release ? The fix has been merged in Symfony (hence closing the bug) but not yet released. |
No, I am using the stable version of 7.2. Not the dev one. Okay, so it's not yet released, got it :) Thank you! |
Hi, has someone found a solution? Because using SF 7.2.0, Twig 3.16.0 and EasyAdmin 4.20.0 I still have the same problem |
@LaurentMarquet this is a known problem of Symfony 7.2.0. The bug has been fixed here: symfony/symfony#59059 but it won't be available until Symfony 7.2.1 is released. |
And maybe it would not happen if you stopped introducing breaking changes into minor versions. Using the weekend excuse as a way to hide the fact that you don't care about us is disrespectful. I will say again in case today you are ready to listen: just emit a major version whenever you introduce breaking changes. We are not your beta testers. |
I believe this is more of a bug than an intended breaking change. I noticed this issue during the 7.2 beta as well, but I'm not sure if it's caused by EasyAdmin, Twig, or Symfony, so I didn't report it. Is there a chatroom or a place where I can submit a general bug report that can be discussed before creating an actual bug report? I'm unsure if Symfony's Slack is active. |
@ericmorand If you eat an apple from a tree and find a worm in it, don't blame the tree |
@pan93412 yes, it'd be very useful to us if you reported this issue when you found it. Next time, please do. Don't worry about reporting the issue in the "wrong" repository; we'll guide you, if needed, to open the issue in the most appropriate repository. About https://symfony.com/slack activity, I can tell you that it's more active than ever so you can use that too if you prefer it. Thanks. |
@ericmorand this bug was not caused by a BC break at all. |
It works for me, thank you ! 🎼 |
Symfony 7.2.1 has been released. |
Hi,
Since twig 3.15, the base layout of easyadmin ( vendor/easycorp/easyadmin-bundle/templates/layout.html.twig ) triggers a warning at line 108 of the template :
{{ item.label|trans }}
.The warning tells that the $_v0 variable is undefined in the compiled version of the twig template, here is the line :
And the full function from the compiled template :
I rolled back to 3.14.2 and all works again.
Thanks
The text was updated successfully, but these errors were encountered: