Browse Source

Fix #17974: Fix ActiveRelationTrait compatibility with PHP 7.4

tags/2.0.35
Maxim Chistyakov 4 years ago committed by GitHub
parent
commit
cb67d07b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/db/ActiveRelationTrait.php

1
framework/CHANGELOG.md

@ -9,6 +9,7 @@ Yii Framework 2 Change Log
- Bug #17942: Fix for `DbCache` loop in MySQL `QueryBuilder` (alex-code)
- Bug #17960: Fix unsigned primary key type mapping for SQLite (bizley)
- 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
framework/db/ActiveRelationTrait.php

@ -242,7 +242,7 @@ trait ActiveRelationTrait
$viaQuery->asArray($this->asArray);
}
$viaQuery->primaryModel = null;
$viaModels = $viaQuery->populateRelation($viaName, $primaryModels);
$viaModels = array_filter($viaQuery->populateRelation($viaName, $primaryModels));
$this->filterByModels($viaModels);
} else {
$this->filterByModels($primaryModels);

Loading…
Cancel
Save