yii2
yii2 copied to clipboard
AttributeTypecastBehavior does not take into consideration Validator's "when" property
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 |