Issue Bug Resolved

#90013Conversion of Extbase to Doctrine query disregards enable field settings for join queries (MM relations)

Joschi Kuphal 12/25/19, 15:50 updated 10/17/26, 13:46

Description

In order to apply custom enable field settings for nested entities, an overloaded QueryFactory can be used (as outlined in https://stackoverflow.com/a/39994951).

In that case, however, the settings made by Typo3QuerySettings::setIgnoreEnableFields() / ::setEnableFieldsToBeIgnored() don’t get applied when the query is converted into a Doctrine QueryBuilder via Typo3DbQueryParser::convertQueryToDoctrineQueryBuilder() respectively ::initializeQueryBuilder(). When the source argument for the latter is a JOIN (which is the case for MM relations), the QueryBuilder is constituted with the unmodified DefaultRestrictionContainer, applying all the default restrictions regardless of the query’s Typo3QuerySettings. This basically makes it impossible to query for nested entities that are e.g. hidden without removing the “disabled” enable field in TCA altogether.

My temporary workaround: I’m using a custom implementation of the Typo3DbQueryParser which amends the original convertQueryToDoctrineQueryBuilder() by selectively applying the enable field query settings to the Doctrine QueryBuilder restriction container (see attachment).

Reviews 3

Files 1

History 38

  1. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-02T07:55:09+00:00" > 10/02/26, 07:55 </span>

    Applied in changeset commit:ca51b417c634c85e68a5a59ccd92f8bebe2bed6e.

  2. Gerrit Code Review pushed patch set 1 for 13.4 to change 96709 status Resolved Under Review <span data-processor="relativetime" data-value="2026-10-15T08:16:52+00:00" > 10/15/26, 08:16 </span>

  3. Alexander Schnitzler commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-10-17T13:46:05+00:00" > 10/17/26, 13:46 </span>

    Resolved by ca51b417c63 “Respect enable field settings for Extbase MM relations” (main, 14.3.8 via 7d31965b28f no backport to 13.4).

    Covered by Extbase Functional Persistence/MmRelationEnableFieldsTest:

    Closing as resolved.