mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	It was causing side effects: https://github.com/yiisoft/yii2/issues/13453
This commit is contained in:
		@ -63,7 +63,6 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
- Enh #7820: Add `or` relation for `targetAttribute` in `yii\validators\UniqueValidator` (developeruz)
 | 
					- Enh #7820: Add `or` relation for `targetAttribute` in `yii\validators\UniqueValidator` (developeruz)
 | 
				
			||||||
- Enh #9053: Added`yii\grid\RadioButtonColumn` (darwinisgod)
 | 
					- Enh #9053: Added`yii\grid\RadioButtonColumn` (darwinisgod)
 | 
				
			||||||
- Enh #9162: Added support of closures in `value` for attributes in `yii\widgets\DetailView` (arogachev)
 | 
					- Enh #9162: Added support of closures in `value` for attributes in `yii\widgets\DetailView` (arogachev)
 | 
				
			||||||
- Enh #10896: Select only primary key when counting records in UniqueValidator (developeruz)
 | 
					 | 
				
			||||||
- Enh #10970: Allow omit specifying empty default params on URL creation (rob006)
 | 
					- Enh #10970: Allow omit specifying empty default params on URL creation (rob006)
 | 
				
			||||||
- Enh #11037: `yii.js` and `yii.validation.js` use `Regexp.test()` instead of `String.match()` (arogachev, nkovacs)
 | 
					- Enh #11037: `yii.js` and `yii.validation.js` use `Regexp.test()` instead of `String.match()` (arogachev, nkovacs)
 | 
				
			||||||
- Enh #11163: Added separate method for client-side validation options `yii\validators\Validator::getClientOptions()` (arogachev)
 | 
					- Enh #11163: Added separate method for client-side validation options `yii\validators\Validator::getClientOptions()` (arogachev)
 | 
				
			||||||
@ -118,6 +117,7 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
- Bug #12599: Fixed MSSQL fail to work with `nvarbinary`. Enhanced SQL scripts compatibility with older versions (samdark)
 | 
					- Bug #12599: Fixed MSSQL fail to work with `nvarbinary`. Enhanced SQL scripts compatibility with older versions (samdark)
 | 
				
			||||||
- Enh #7435: Added `EVENT_BEFORE_RUN`, `EVENT_AFTER_RUN` and corresponding methods to `yii\base\Widget` (petrabarus)
 | 
					- Enh #7435: Added `EVENT_BEFORE_RUN`, `EVENT_AFTER_RUN` and corresponding methods to `yii\base\Widget` (petrabarus)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2.0.10 October 20, 2016
 | 
					2.0.10 October 20, 2016
 | 
				
			||||||
-----------------------
 | 
					-----------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -161,7 +161,7 @@ class UniqueValidator extends Validator
 | 
				
			|||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            // if current $model is in the database already we can't use exists()
 | 
					            // if current $model is in the database already we can't use exists()
 | 
				
			||||||
            /** @var $models ActiveRecordInterface[] */
 | 
					            /** @var $models ActiveRecordInterface[] */
 | 
				
			||||||
            $models = $query->select($targetClass::primaryKey())->limit(2)->all();
 | 
					            $models = $query->limit(2)->all();
 | 
				
			||||||
            $n = count($models);
 | 
					            $n = count($models);
 | 
				
			||||||
            if ($n === 1) {
 | 
					            if ($n === 1) {
 | 
				
			||||||
                $keys = array_keys($conditions);
 | 
					                $keys = array_keys($conditions);
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user