Такой ошибки можно добиться применяя этот валидатор к модели у которой в defaultScope есть параметр index.Undefined offset: 0 in framework/validators/CUniqueValidator.php(108)
$exists=$objects[0]->getPrimaryKey()!=$object->getOldPrimaryKey();
Сделать минимальный фикс можно применяя вместо обращения к индексу функцию array_shift.
Код: Выделить всё
if(!$object instanceof CActiveRecord || $object->isNewRecord || $object->tableName()!==$finder->tableName())
$exists=$finder->exists($criteria);
else
{
$criteria->limit=2;
$objects=$finder->findAll($criteria);
$n=count($objects);
if($n===1)
{
if($column->isPrimaryKey) // primary key is modified and not unique
$exists=$object->getOldPrimaryKey()!=$object->getPrimaryKey();
else // non-primary key, need to exclude the current record based on PK
//$exists=$objects[0]->getPrimaryKey()!=$object->getOldPrimaryKey();
$exists=array_shift($objects)->getPrimaryKey()!=$object->getOldPrimaryKey();
}
else
$exists=$n>1;
}