LexikFormFilterBundle icon indicating copy to clipboard operation
LexikFormFilterBundle copied to clipboard

Symfony 4.2 deprecation warning (not implementing the static getExtendedTypes() method)

Open nmeirik opened this issue 7 years ago • 4 comments

After upgrading to Symfony 4.2 the following deprecation warning is thrown which seems to be related to this bundle:

Not implementing the static getExtendedTypes() method in %lexik_form_filter.type_extension.filter_extension.class% when implementing the Symfony\Component\Form\FormTypeExtensionInterface is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.

Additional information is available here.

nmeirik avatar Dec 01 '18 13:12 nmeirik

Hi,

If you want to contribute you can propose a PR ;)

But one day I will check that issue!

gilles-g avatar Jan 21 '19 07:01 gilles-g

Just implementing a getExtendedTypes() method in Lexik\Bundle\FormFilterBundle\Filter\Form\FilterTypeExtension doesn't remove the deprecation warning, since the lexik_form_filter.type_extension.filter_extension service is still tagged with <tag name="form.type_extension" extended_type="Symfony\Component\Form\Extension\Core\Type\FormType" />. Removing this tag silences the deprecation warning, but will break the service in older symfony-versions I guess. I don't know how to deal with that, but when that can be solved, that would be all.

spackmat avatar Mar 04 '19 10:03 spackmat

Sorry, removing the tag from the service definition doesn't work. I removes the deprecated message but afterwards the filter extension doesn't work anymore. So the service must be autoconfigured to work without the tag.

spackmat avatar Mar 06 '19 08:03 spackmat

I've been investigating this deprecation and it's closely tied to using parameters as the given class to the service definitions.

I've reported a bug here but I think using proper classes in the service definitions is the way to go, since the bundle is not really taking advantage of them (they're not being exposed in the bundle configuration, for instance).

antoniocambados avatar Apr 10 '19 08:04 antoniocambados