8000 Form extension back compatibility broken at 3.4 · Issue #25659 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Form extension back compatibility broken at 3.4 #25659

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

Closed
Avariya opened this issue Jan 2, 2018 · 3 comments
Closed

Form extension back compatibility broken at 3.4 #25659

Avariya opened this issue Jan 2, 2018 · 3 comments

Comments

@Avariya
Copy link
Avariya commented Jan 2, 2018
Q A
Bug report? no
Feature request? no
BC Break report? yes
RFC? nope?
Symfony version 3.4.2

Hi, vendor I using expected that twig.form.renderer service is implementing TwigRendererInterface. It was removed at Symfony4 and marked as deprecated at 3.4.
But at Symfony 3.4 already FormRendererInterface implementation was received. So, now I need to change expected type, what brakes BC with 3.*,
So, my request is to let twig.form.renderer implement Symfony\Bridge\Twig\Form\TwigRendererInterface at Symfony3.4 only.

Vendor lib:
https://github.com/genemu/GenemuFormBundle/pull/446/files
https://github.com/genemu/GenemuFormBundle/blob/master/Resources/config/twig.xml

IMHO, the bug should be fixed at Symfony 3.4 side. Am I right?

Related issue: #24616

@dmaicher
Copy link
Contributor
dmaicher commented Jan 6, 2018

If we revert the service definition change on 3.4 (so keep using the deprecated TwigRendererInterface) then it might be fine for all people who expect an instance of FormRendererInterface.

An issue is that the twig runtime would also change again and possibly introduce problems again for projects that adapted to the non-deprecated class.

See sonata-project/SonataAdminBundle#4758

What do you think @Tobion @nicolas-grekas ? Should we try to fix this on 3.4? Or do we allow this BC break?

Maybe we can somehow have both runtimes?

So

$twig->getRuntime('Symfony\Bridge\Twig\Form\TwigRenderer')

and

$twig->getRuntime('Symfony\Component\Form\FormRenderer')

will work?

@nicolas-grekas
Copy link
Member

@dmaicher if you want to give it a try, please do. The less BC break the better (reverting a BC break is a BC break as you said, so we should be careful, and select the best middle ground, if any)

@dmaicher
Copy link
Contributor

@nicolas-grekas I had some time to check it and proposed a PR: #26553

If you have time please have a look 😉

fabpot added a commit that referenced this issue Mar 18, 2018
….4 (dmaicher)

This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] document TwigRenderer BC break in UPGRADE-3.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? |no
| Tests pass?   | yes
| Fixed tickets | #24616, #25659
| License       | MIT
| Doc PR        | -

This is a follow up for #26553 as it seems impossible to fix the BC break in a clean way for everyone.

ping @nicolas-grekas @Tobion

Commits
-------

47a3d7a [TwigBundle] document TwigRenderer BC break in UPGRADE-3.4
@fabpot fabpot closed this as completed Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
0