mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 18:47:33 +08:00 
			
		
		
		
	Fix #17974: Fix ActiveRelationTrait compatibility with PHP 7.4
This commit is contained in:
		| @ -9,6 +9,7 @@ Yii Framework 2 Change Log | |||||||
| - Bug #17942: Fix for `DbCache` loop in MySQL `QueryBuilder` (alex-code) | - Bug #17942: Fix for `DbCache` loop in MySQL `QueryBuilder` (alex-code) | ||||||
| - Bug #17960: Fix unsigned primary key type mapping for SQLite (bizley) | - Bug #17960: Fix unsigned primary key type mapping for SQLite (bizley) | ||||||
| - Enh #17758: `Query::withQuery()` can be used for CTE (sartor) | - Enh #17758: `Query::withQuery()` can be used for CTE (sartor) | ||||||
|  | - Bug #17974: Fix ActiveRelationTrait compatibility with PHP 7.4 (Ximich) | ||||||
|  |  | ||||||
|  |  | ||||||
| 2.0.34 March 26, 2020 | 2.0.34 March 26, 2020 | ||||||
|  | |||||||
| @ -242,7 +242,7 @@ trait ActiveRelationTrait | |||||||
|                 $viaQuery->asArray($this->asArray); |                 $viaQuery->asArray($this->asArray); | ||||||
|             } |             } | ||||||
|             $viaQuery->primaryModel = null; |             $viaQuery->primaryModel = null; | ||||||
|             $viaModels = $viaQuery->populateRelation($viaName, $primaryModels); |             $viaModels = array_filter($viaQuery->populateRelation($viaName, $primaryModels)); | ||||||
|             $this->filterByModels($viaModels); |             $this->filterByModels($viaModels); | ||||||
|         } else { |         } else { | ||||||
|             $this->filterByModels($primaryModels); |             $this->filterByModels($primaryModels); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Maxim Chistyakov
					Maxim Chistyakov