From 68f65a9f7a6e030032b8088d472b3f1210262af6 Mon Sep 17 00:00:00 2001 From: Alexander Kochetov Date: Wed, 14 May 2014 13:37:20 +0400 Subject: [PATCH] ExistValidator bugfix --- framework/validators/ExistValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/validators/ExistValidator.php b/framework/validators/ExistValidator.php index 6479395410..a3aa4aa652 100644 --- a/framework/validators/ExistValidator.php +++ b/framework/validators/ExistValidator.php @@ -111,7 +111,7 @@ class ExistValidator extends Validator $query = $this->createQuery($targetClass, $params); if (is_array($object->$attribute)) { - if ($query->count("DISTINCT [[$targetAttribute]]") === count($object->$attribute)) { + if ($query->count("DISTINCT [[$targetAttribute]]") == count($object->$attribute)) { return; } } elseif ($query->exists()) {