Skip to content

Commit bc55d58

Browse files
committed
Fix relations with through
1 parent feea063 commit bc55d58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/db/ar/CActiveFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function find($criteria=null)
442442
}
443443
elseif(!$this->_joined && !empty($this->_parent->records)) // not joined before
444444
{
445-
if (count($this->relation->foreignKey) === count($this->_parent->_pkAlias)) {
445+
if (empty($this->relation->through) && count($this->relation->foreignKey) === count($this->_parent->_pkAlias)) {
446446
$query = new CJoinQuery($this);
447447
$this->_joined = true;
448448
$query->selects = array(); // reset to not receive the extra keys

0 commit comments

Comments
 (0)