Bug #90013

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

Added by Joschi Kuphal almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2019-12-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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).


Files

Typo3DbQueryParser.php (2.14 KB) Typo3DbQueryParser.php Custom Typo3DbQueryParser with amended Joschi Kuphal, 2019-12-25 15:46

Related issues

Related to TYPO3 Core - Bug #91324: Visibility restrictions are added twice for Extbase ObjectStorage relationsNew2020-05-06

Actions
#1

Updated by Markus Klein 7 months ago

  • Related to Bug #91324: Visibility restrictions are added twice for Extbase ObjectStorage relations added

Also available in: Atom PDF