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

AttributeTypecastBehavior does not take into consideration Validator's "when" property #19865

Open
uniquexor opened this issue Jun 15, 2023 · 0 comments
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement

Comments

@uniquexor
Copy link

What steps will reproduce the problem?

If you have a model with an attribute, which can be either a string or an integer, defined by two validation rules with "when" property, when using AttributeTypecastBehavior in auto-detect mode it will only consider the first validation rule, without checking if "when" condition is satisfied.

What is the expected result?

AttributeTypecastBehavior should check if "when" condition is satisfied when detecting attribute types.

What do you get instead?

The type of a first rule.

Additional info

Q A
Yii version 2.0.48
PHP version
Operating system
@samdark samdark added type:enhancement status:ready for adoption Feel free to implement this issue. labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement
Projects
None yet
Development

No branches or pull requests

2 participants