Bug #92442 » INP-1208-handle-hidden-preview-on-foreign-languages.patch
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php | ||
---|---|---|
use TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression;
|
||
use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
|
||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
|
||
use TYPO3\CMS\Core\Domain\Repository\PageRepository;
|
||
use TYPO3\CMS\Core\Http\ApplicationType;
|
||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||
... | ... | |
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
|
||
use TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException;
|
||
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
||
use TYPO3\CMS\Extbase\Service\EnvironmentService;
|
||
/**
|
||
* QueryParser, converting the qom to string representation
|
||
... | ... | |
{
|
||
protected DataMapper $dataMapper;
|
||
protected EnvironmentService $environmentService;
|
||
/**
|
||
* The TYPO3 page repository. Used for language and workspace overlay
|
||
*
|
||
... | ... | |
*/
|
||
protected $suggestDistinctQuery = false;
|
||
public function __construct(DataMapper $dataMapper)
|
||
public function __construct(DataMapper $dataMapper, EnvironmentService $environmentService)
|
||
{
|
||
$this->dataMapper = $dataMapper;
|
||
$this->environmentService = $environmentService;
|
||
}
|
||
/**
|
||
... | ... | |
/** @var ColumnMap $columnMap */
|
||
$relationTableName = (string)$columnMap->getRelationTableName();
|
||
$queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
|
||
if ($this->environmentService->isEnvironmentInFrontendMode()) {
|
||
$queryBuilderForSubselect->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||
}
|
||
$queryBuilderForSubselect
|
||
->select($columnMap->getParentKeyFieldName())
|
||
->from($relationTableName)
|
||
... | ... | |
// Build the SQL statement of the subselect
|
||
$queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
|
||
if ($this->environmentService->isEnvironmentInFrontendMode()) {
|
||
$queryBuilderForSubselect->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||
}
|
||
$queryBuilderForSubselect
|
||
->select($parentKeyFieldName)
|
||
->from($childTableName)
|
||
... | ... | |
$defLangTableAlias = $tableAlias . '_dl';
|
||
$defaultLanguageRecordsSubSelect = $this->queryBuilder->getConnection()->createQueryBuilder();
|
||
if ($this->environmentService->isEnvironmentInFrontendMode()) {
|
||
$defaultLanguageRecordsSubSelect->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||
}
|
||
$defaultLanguageRecordsSubSelect
|
||
->select($defLangTableAlias . '.uid')
|
||
->from($tableName, $defLangTableAlias)
|
||
... | ... | |
// together with not translated default language records
|
||
$translatedOnlyTableAlias = $tableAlias . '_to';
|
||
$queryBuilderForSubselect = $this->queryBuilder->getConnection()->createQueryBuilder();
|
||
if ($this->environmentService->isEnvironmentInFrontendMode()) {
|
||
$queryBuilderForSubselect->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
|
||
}
|
||
$queryBuilderForSubselect
|
||
->select($translatedOnlyTableAlias . '.' . $transOrigPointerField)
|
||
->from($tableName, $translatedOnlyTableAlias)
|