form-extensions icon indicating copy to clipboard operation
form-extensions copied to clipboard

Deprecate InlineConstraint and validator

Open jordisala1991 opened this issue 2 years ago • 6 comments

Feature Request

I think it can be deprecated. It's usage was deprecated on SonataAdminBundle 3.x. We need to look for usage on another Sonata bundles.

Maybe ErrorElement too (but not sure about that one).

jordisala1991 avatar May 08 '22 18:05 jordisala1991

It is still used on PageBundle and MediaBundle to validate medias and pages. So probably not that easy to deprecate.

jordisala1991 avatar May 08 '22 18:05 jordisala1991

It is still used on PageBundle and MediaBundle to validate medias and pages. So probably not that easy to deprecate.

I didnt take a look but cant we just replace the usage by the "constraints" option on form ?

VincentLanglet avatar May 08 '22 18:05 VincentLanglet

I think we could try to replace it for the Callback constraint from Symfony, but haven't tried yet.

jordisala1991 avatar May 08 '22 19:05 jordisala1991

I remove the milestone since it won't be done for 2.0, it requires changes on another bundles that are already released (MediaBundle)

jordisala1991 avatar May 12 '22 07:05 jordisala1991

I remove the milestone since it won't be done for 2.0, it requires changes on another bundles that are already released (MediaBundle)

Can't we remove the usage in a BC way ?

Looking at the usage we just have to

  • Deprecate everything in 1.x
  • Remove everything in 2.x except ErrorElement
  • Remove ErrorElement in 3.x

This way, support for 1.x || 2.x is possible with the empty method

    public function validate(ErrorElement $errorElement, BlockInterface $block): void
    {
    }

VincentLanglet avatar May 12 '22 07:05 VincentLanglet

To me there is a previous step:

  • Ensure on MediaBundle and PageBundle that everything can be implemented without this classes.

If we don't change the deprecated code first, we could end up in a situation where we deprecated something that cannot be done with another solution.

jordisala1991 avatar May 12 '22 07:05 jordisala1991