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

Fixed creating built-in validator in model with same function name #14499

Merged

Conversation

dmirogin
Copy link
Contributor

Q A
Is bugfix? yes
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues #14370

/**
* @see https://github.com/yiisoft/yii2/issues/14370
*/
private function number()
Copy link
Member

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()?

Copy link
Contributor Author

@dmirogin dmirogin Jul 21, 2017

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.

Copy link
Member

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

Copy link
Member

@dynasource dynasource left a 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

@cebe cebe added this to the 2.0.14 milestone Jul 22, 2017
@samdark samdark merged commit 8ae2223 into yiisoft:master Jul 23, 2017
@samdark
Copy link
Member

samdark commented Jul 23, 2017

Merged. Thanks!

@samdark samdark self-assigned this Jul 23, 2017
@samdark samdark added the type:bug Bug label Jul 23, 2017
@samdark samdark modified the milestones: 2.0.13, 2.0.14 Jul 23, 2017
SilverFire added a commit that referenced this pull request Sep 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants