Skip to content

[Bug][BC break][Form] getExtendedTypes is suddenly required #29426

Closed
@greg0ire

Description

@greg0ire

Symfony version(s) affected: 4.2.0

Description
The SonataAdminBundle build breaks because we have form types that suddenly need to implement getExtendedTypes(). This lines seems to assume the method exists when it actually does not:

foreach ($extension::getExtendedTypes() as $type) {

How to reproduce

git clone git@github.com:sonata-project/SonataAdminBundle.git
cd SonataAdminBundle
git checkout 437ed2a9aa09fac6bef66abeaf1e5eeb9b32796d
composer install
wget -O phpunit https://phar.phpunit.de/phpunit-5.phar
chmod +x phpunit
./phpunit tests/Form/Type/AdminTypeTest.php

Possible Solution
Provide a default implementation for that method, that would check if getExtendedType() is overriden in the child class, and trigger a deprecation if it is the case, call it and wrap the result in an array.

That cannot work since the new method has to be static…

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions