From a2dd048aca3c5994661abf61b5e982cea258b358 Mon Sep 17 00:00:00 2001 From: Stefan Linke Date: Sat, 26 Aug 2023 03:08:16 +0200 Subject: [PATCH] Add note to UPGRADE guide for change in Validator behavior (#19938) The `unique` and `exists` validators behave slightly different since 2.0.46 (issue #19407) when used on multiple/combined attributes. See: https://github.com/yiisoft/yii2/issues/19407#issuecomment-1689625762 --- UPGRADE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 7d2ca03eb..3a9569a98 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -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 -----------------------