-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fixed creating built-in validator in model with same function name #14499
Fixed creating built-in validator in model with same function name #14499
Conversation
dmirogin
commented
Jul 20, 2017
Q | A |
---|---|
Is bugfix? | yes |
New feature? | no |
Breaks BC? | no |
Tests pass? | yes |
Fixed issues | #14370 |
…h same function name
/** | ||
* @see https://github.com/yiisoft/yii2/issues/14370 | ||
*/ | ||
private function number() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this be mapped to a configured rule Rules()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dynasource This bug happens when you have function in model class with name that same to one of built-in validators. And Validator::createValidator create InlineValidator instead NumberValidator in this case. I can make separate model class and test for getting this more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. It's a bit magical in the current form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks more verbose now
Merged. Thanks! |