Issue Bug Closed

#91324Visibility restrictions are added twice for Extbase ObjectStorage relations

Anonymous 05/06/20, 15:44 updated 09/02/26, 13:30

Description

In \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::convertQueryToDoctrineQueryBuilder(), a \TYPO3\CMS\Core\Database\Query\QueryBuilder is created by calling \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::initializeQueryBuilder(). If $source is a \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface, which is the case for ObjectStorage, default TYPO3 enablefield constraints (QueryBuilder restrictions) do not get removed. This is done when $source is not a JoinInterface.
After wards, constraints are added in \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser::addTypo3Constraints(), where Query::$querySettings are taken into account.

So there are two Issues:
  1. enable field constraints are added twice to the resulting SQL query
  2. manipulated QuerySettings in an implementation of \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory\QueryFactory are ignored for relations with ObjectStorage (suggested here: https://stackoverflow.com/a/39994951/13483282)

Reviews 3

History 4

  1. Benni Mack commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2025-08-14T16:17:11+00:00" > 08/14/25, 16:17 </span>

    Hey, I’m pretty sure I fixed this last month – together with #92442 – can you confirm this is gone in v13?

  2. Georg Ringer commented and changed status Needs Feedback Closed <span data-processor="relativetime" data-value="2026-09-02T13:30:27+00:00" > 09/02/26, 13:30 </span>

    closing the issue because of lack of feedback. feel free to contact me to reopen it or create a new issue if still valid