Skip to content
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

Deprecate InlineConstraint and validator #333

Open
jordisala1991 opened this issue May 8, 2022 · 6 comments
Open

Deprecate InlineConstraint and validator #333

jordisala1991 opened this issue May 8, 2022 · 6 comments

Comments

@jordisala1991
Copy link
Member

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 jordisala1991 added this to the 2.0 milestone May 8, 2022
@jordisala1991
Copy link
Member Author

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

@VincentLanglet
Copy link
Member

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 ?

@jordisala1991
Copy link
Member Author

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

@jordisala1991 jordisala1991 removed this from the 2.0 milestone May 12, 2022
@jordisala1991
Copy link
Member Author

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

@VincentLanglet
Copy link
Member

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
    {
    }

@jordisala1991
Copy link
Member Author

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.

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

2 participants