Set $propertyPath, $tableName and $className to avoid
unnecessary joins and wrong repository results.
This is a regression fix after the Doctrine migration.
Resolves: #79286
Related: #77379
Releases: master
Change-Id: I64489b46b9ca751535b64482f54ceb7b2da05003
Reviewed-on: https://review.typo3.org/51290
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
$fullPropertyPath .= ($fullPropertyPath === '') ? $propertyName : '.' . $propertyName;
$childTableAlias = $this->getUniqueAlias($childTableName, $fullPropertyPath);
- // If there is already exists a union with the current identifier we do not need to build it again and exit early.
+ // If there is already a union with the current identifier we do not need to build it again and exit early.
if (in_array($childTableAlias, $this->unionTableAliasCache, true)) {
+ $propertyPath = $explodedPropertyPath[1];
+ $tableName = $childTableAlias;
+ $className = $this->dataMapper->getType($className, $propertyName);
return;
}
)
);
- $this->assertSame(10, $query->count());
+ // QueryResult is lazy, so we have to run valid method to initialize
+ $result = $query->execute();
+ $result->valid();
+
+ $this->assertSame(10, $result->count());
}
/**