Skip to content

Commit

Permalink
Add note to UPGRADE guide for change in Validator behavior (#19938)
Browse files Browse the repository at this point in the history
The `unique` and `exists` validators behave slightly different since
2.0.46 (issue #19407) when used on multiple/combined attributes.

See: #19407 (comment)
  • Loading branch information
particleflux authored Aug 26, 2023
1 parent 4c0a00f commit d5b3b6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions framework/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ Upgrade from Yii 2.0.45
2.0.45 behavior, [introduce your own method](https://github.com/yiisoft/yii2/pull/19495/files).
* `yii\log\FileTarget::$rotateByCopy` is now deprecated and setting it to `false` has no effect since rotating of
the files is done only by copy.
* `yii\validators\UniqueValidator` and `yii\validators\ExistValidator`, when used on multiple attributes, now only
generate an error on a single attribute. Previously, they would report a separate error on each attribute.
Old behavior can be achieved by setting `'skipOnError' => false`, but this might have undesired side effects with
additional validators on one of the target attributes.
See [issue #19407](https://github.com/yiisoft/yii2/issues/19407)

Upgrade from Yii 2.0.44
-----------------------
Expand Down

0 comments on commit d5b3b6c

Please sign in to comment.