Skip to content

Commit c388a89

Browse files
committed
[TASK] Add workaround for a problem with the QueryObjectModelFactory converting the QueryBuilder to string
1 parent ad87c7a commit c388a89

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Classes/Domain/Repository/LocationRepository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
2828
use TYPO3\CMS\Core\Utility\GeneralUtility;
2929
use TYPO3\CMS\Extbase\Persistence\Generic\Exception as ExtbaseException;
30+
use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement;
3031
use TYPO3\CMS\Extbase\Persistence\Generic\Query;
3132
use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface;
3233
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
@@ -177,7 +178,10 @@ public function findByConstraint(Constraint $constraint, bool $raw = false): arr
177178
->executeQuery()
178179
->fetchAllAssociative();
179180
} else {
180-
$query->statement($queryBuilder);
181+
// @todo remove once an error cause in https://review.typo3.org/c/Packages/TYPO3.CMS/+/88690 was fixed
182+
$statementProperty = new \ReflectionProperty($query, 'statement');
183+
$statement = GeneralUtility::makeInstance(Statement::class, $queryBuilder, []);
184+
$statementProperty->setValue($query, $statement);
181185
return $query->execute()->toArray();
182186
}
183187
}

0 commit comments

Comments
 (0)