-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] FormExtension/TwigRenderer/FormRenderer BC break on 3.4 #24533
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
Comments
…enderer (dmaicher) This PR was squashed before being merged into the 3.4 branch (closes #24535). Discussion ---------- [TwigBridge] fix BC for FormExtension if renderer is FormRenderer | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#24533 | License | MIT | Doc PR | - This fixes some issues within FormExtension since the renderer is now a `FormRenderer`. Commits ------- 4a2f608f1e [TwigBridge] fix BC for FormExtension if renderer is FormRenderer
…enderer (dmaicher) This PR was squashed before being merged into the 3.4 branch (closes #24535). Discussion ---------- [TwigBridge] fix BC for FormExtension if renderer is FormRenderer | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24533 | License | MIT | Doc PR | - This fixes some issues within FormExtension since the renderer is now a `FormRenderer`. Commits ------- 4a2f608 [TwigBridge] fix BC for FormExtension if renderer is FormRenderer
I think this BC-break was not fixed in the released 3.4 version. I'm getting a
After updating my dependencies. Probably also the reason, why sonata-project/SonataAdminBundle#4762 has a separate BC-Layer-Fix? Can we get a proper fix in 3.4.1? EDIT: Oh, it maybe was only not fixed in silexphp/Silex#1579 |
@mricherzhagen I also have some concerns about that issue and am not 100% sure its fixed for all possible use cases out there. See #24535 (comment) If you still experience issues (not related to silex) then please open a new issue 😉 |
I only use Silex at the moment, but i don't think this issue is related to silex, because @jordisala1991 had to write a fix for the SonataAdminBundle which is Symfony and not Silex. I think the twig cache might also play some role in why this is a little weird to debug. I had to clear it manually in order to get an effect. |
I am still experiencing this issue with Symfony 3.4.2, but not with 3.3. I used the documentation from https://symfony.com/doc/3.4/components/form.html to create a simple test. https://gist.github.com/sproctor/7a5d5a322cc89b6839cf4d414822c316 |
@sproctor true! Unfortunately the documentation is outdated 😢 I will create a PR to update it accordingly. With this it works? $twig->addRuntimeLoader(new \Twig_FactoryRuntimeLoader(array(
\Symfony\Component\Form\FormRenderer::class => function () use ($formEngine, $csrfManager) {
return new \Symfony\Component\Form\FormRenderer($formEngine, $csrfManager);
},
))); |
Using deprecated `TwigRenderer` actually is not working correctly anymore as mentioned here symfony/symfony#24533 (comment). This should also be merged into 4.0 and master as there the class has been removed completely.
@dmaicher That did it! Thank you! |
This PR was merged into the 3.4 branch. Discussion ---------- [Form] use FormRenderer instead of TwigRenderer Using deprecated `TwigRenderer` actually is not working correctly anymore as mentioned here symfony/symfony#24533 (comment). This should also be merged into 4.0 and master as there the class has been removed completely. Commits ------- e86433d [Form] use FormRenderer instead of TwigRenderer
More details at symfony/symfony#24533
Uh oh!
There was an error while loading. Please reload this page.
I just tried upgrading one of my apps from 3.3.10 to symfony 3.4.x-dev and stumbled across this issue in combination with Sonata admin: sonata-project/SonataAdminBundle#4652
As far as I understand the TwigRenderer was deprecated and is now actually an instance of FormRenderer?
Which breaks code like this (which is done in a similar way on Sonata admin):
Or this:
As this check is not true anymore https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bridge/Twig/Extension/FormExtension.php#L55
And this method
setEnvironment
does not exist onFormRenderer
: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bridge/Twig/Extension/FormExtension.php#L122The text was updated successfully, but these errors were encountered: