Bug #92769
Updated by Albrecht Köhnlein about 4 years ago
Hi everybody, I'm having a repository, where I have defined an ordering rule by a related property. This works find for example in <code>findAll()</code> method, where no constraint exists. But as soon as I am setting an individual constraint, this runs in an PHP error, inside a doctrine method. Example repository: <pre><code class="php"> class TrainingRepository extends \TYPO3\CMS\Extbase\Persistence\Repository { protected $defaultOrderings = [ 'singleSelectRelation.title' => QueryInterface::ORDER_ASCENDING ]; public function findFiltered(): QueryResultInterface { $query = $this->createQuery(); $query->matching($query->contains('fieldWithMMRelation', 123)); return $query->execute(); } } </code></pre> Error message: <pre>ArgumentCountError: Too few arguments to function Doctrine\DBAL\Query\Expression\CompositeExpression::with(), 0 passed in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php on line 837 and exactly 1 expected /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php:119 /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:837 /var/www/html/private/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php:666 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php:1062 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php:316 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php:205 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php:359 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php:220 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php:115 /var/www/html/private/typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php:129</pre> To be honest, I did not exactly investigate, if this problem only exists with constraints, using a relation, or if even simple constraints constraints, fail too.