Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Always map association fields.
This ensures that association fields are in the typemap to cover cases
where fields are used in conditions for the matching() clause.

Refs #8147
  • Loading branch information
markstory committed Feb 3, 2016
1 parent ae5b1bf commit 501358c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ORM/Association.php
Expand Up @@ -719,8 +719,8 @@ protected function _appendFields($query, $surrogate, $options)

if (!empty($fields)) {
$query->select($query->aliasFields($fields, $target->alias()));
$query->addDefaultTypes($target);
}
$query->addDefaultTypes($target);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/ORM/EagerLoaderTest.php
Expand Up @@ -170,7 +170,7 @@ public function testContainToJoinsOneLevel()
'type' => 'LEFT',
'conditions' => new QueryExpression([
['clients.id' => new IdentifierExpression('foo.client_id')],
], $this->clientsTypeMap)
], new TypeMap($this->clientsTypeMap->defaults()))
]])
->will($this->returnValue($query));

Expand Down

0 comments on commit 501358c

Please sign in to comment.