-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Form option is settable only for first created form #45229
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
Labels
Comments
Can you investigate which properties would need to be reset after handling a request? |
I needed to reset only block_prefix property. But I think all properties should be reset. |
It'd still be great if you could confirm please, we never know how bugs happen :) |
fabpot
added a commit
that referenced
this issue
Apr 1, 2022
… requests (xabbuh) This PR was merged into the 4.4 branch. Discussion ---------- [Form][TwigBundle] reset Twig form theme resources between requests | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #45229 | License | MIT | Doc PR | Commits ------- 873a86e reset Twig form theme resources between requests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
5.4.2
Description
The problem appears when running symfony as a daemon with swoole web server. The option block_prefix is settable once. In other requests it is impossible to set this option to another value. Twig renders form as the block_prefix is not changed, although each time new form instance is created.
How to reproduce
Example is from EasyCorp\Bundle\EasyAdminBundle\Factory:
If set first parameter to something random value the problem disappears.
And in controller set option like this:
Possible Solution
I have decorated twig.form.engine (Symfony\Bridge\Twig\Form\TwigRendererEngine) with function, which is called on kernel.request event:
It works, but I am not sure it is the right solution.
Additional Context
No response
The text was updated successfully, but these errors were encountered: