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
Make validator getClientOptions public #13145
Make validator getClientOptions public #13145
Conversation
could you add that note to the UPGRADE guide please? |
This allows implementing custom client-side validation without extending every validator. Fixes yiisoft#11163
4d2c016
to
97ca9dc
Compare
Done. |
Since it's a backwards compatibilty break and isn't critical to have in 2.0.x, I'd merge it into 2.1.0 instead. @cebe ? |
I insist to merge this PR in 2.0.11 and here are the reasons:
|
There's also the option of calling it something else (though even then you're introducing a BC break, since if you call it foobar, and someone has a validator class with a protected function foobar, it'll break their code; the likelihood of this is lower, of course). |
Need a changelog. Then ready to merge. |
no need for a changelog, #11163 does already have one. |
merged, thank you! |
This allows implementing custom client-side validation
without extending every validator.
The backwards compatibility break is caused by the change in ImageValidator.
ImageValidator::getClientOptions
was protected since 2.0.0 (6dd2203#diff-504fd084646834cd27fce3dbdce26bbeR350), so if you extended the class and overrode the method with a protected method, the visibility change will cause a fatal error (because you can't make a public method protected in a subclass).Fixes #11163