Deprecate MediaProviderInterface::validate()#2499
Deprecate MediaProviderInterface::validate()#2499dmaicher wants to merge 1 commit intosonata-project:4.xfrom
Conversation
c96dab5 to
cdceb01
Compare
cdceb01 to
c100b76
Compare
VincentLanglet
left a comment
There was a problem hiding this comment.
Seems an interesting solution, the only issue I see
-
If it's really Backward compatible for someone overriding validate method (and eventually rely on parent::validate)
-
We have BlockBundle using it a lot https://github.com/search?q=repo%3Asonata-project%2FSonataBlockBundle%20ErrorElement&type=code and every bundle implementing those interface. Like SonataPageBundle or SonataClassificationBundle.
-
More important, with our lack of maintainer/contributor, I dunno if there will be a new major one day and when...
| } | ||
|
|
||
| public function validate(ErrorElement $errorElement, MediaInterface $media): void | ||
| public function validateMedia(ExecutionContextInterface $context, MediaInterface $media): void |
There was a problem hiding this comment.
There is no BC break issue if someone is extending the validate method ?
There was a problem hiding this comment.
It should be compatible as I added those checks if a child class overwrites them inside BaseProvider 🤔
Should be. See #2499 (comment)
Yeah that would indeed be the bigger work to deprecate and fix those 😢
Valid point. Maybe its not worth it for now anyway. I don't use this bundle myself anyway. |
Subject
I am targeting this branch, because {reason}.
Relates to sonata-project/form-extensions#333
Changelog
To do
@sonata-project/contributors this is a draft for now. Before I continue to finalize it I wanted to get your feedback on it.
To achieve sonata-project/form-extensions#333 we need to get rid of
ErrorElementandInlineConstraintusages here.From what I see we can easily achieve the validation with the proposed approach here by introducing a new
validateMedia()method.WDYT?