Fixes #4970: joinWith() called by a relation was ignored by yii\db\ActiveQuery

This commit is contained in:
Qiang Xue
2014-09-10 15:00:15 -04:00
parent 70ed5d5c01
commit 2150fa3239
3 changed files with 5 additions and 4 deletions

View File

@ -91,6 +91,7 @@ Yii Framework 2 Change Log
- Bug #4880: Return value of yii\web\Request::getPrefferedLanguage() was a normalized value instead of a valid language value from the input array (cebe)
- Bug #4920: `yii\filters\auth\CompositeAuth` should not trigger error as long as one of the methods succeeds (qiangxue)
- Bug #4954: MSSQL column comments are not retrieved correctly (SerjRamone)
- Bug #4970: `joinWith()` called by a relation was ignored by `yii\db\ActiveQuery` (stepanselyuk)
- Bug: Fixed inconsistent return of `\yii\console\Application::runAction()` (samdark)
- Bug: URL encoding for the route parameter added to `\yii\web\UrlManager` (klimov-paul)
- Bug: Fixed the bug that requesting protected or private action methods would cause 500 error instead of 404 (qiangxue)

View File

@ -482,9 +482,9 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$relations[$fullName] = $relation = $primaryModel->getRelation($name);
if ($callback !== null) {
call_user_func($callback, $relation);
if(is_array($relation->joinWith)) {
$relation->buildJoinWith();
}
}
if (!empty($relation->joinWith)) {
$relation->buildJoinWith();
}
$this->joinWithRelation($parent, $relation, $this->getJoinType($joinType, $fullName));
}