8000 [TwigBridge] FormExtension/TwigRenderer/FormRenderer BC break on 3.4 · Issue #24533 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[TwigBridge] FormExtension/TwigRenderer/FormRenderer BC break on 3.4 #24533
Closed
@dmaicher

Description

@dmaicher
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4.x-dev 0f5e38c

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):

$twig = $this->get('twig');

$twig
    ->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')
    ->initRuntime($twig);

$twig
    ->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')
    ->renderer;

Or this:

$twig = $this->get('twig');

$twig
    ->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')
    ->renderer;

$twig
    ->getExtension('Symfony\Bridge\Twig\Extension\FormExtension')
    ->initRuntime($twig);

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 on FormRenderer: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bridge/Twig/Extension/FormExtension.php#L122

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0