Bug #85471 » 0001-BUGFIX-Enable-preview-of-hidden-page-translations.patch
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php | ||
---|---|---|
protected function determineIdIsHiddenPage()
|
||
{
|
||
$field = MathUtility::canBeInterpretedAsInteger($this->id) ? 'uid' : 'alias';
|
||
|
||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||
->getQueryBuilderForTable('pages');
|
||
$queryBuilder
|
||
... | ... | |
->removeAll()
|
||
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||
$page = $queryBuilder
|
||
$queryBuilder
|
||
->select('uid', 'hidden', 'starttime', 'endtime')
|
||
->from('pages')
|
||
->where(
|
||
$queryBuilder->expr()->eq($field, $queryBuilder->createNamedParameter($this->id)),
|
||
$queryBuilder->expr()->gte('pid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
|
||
)
|
||
->setMaxResults(1)
|
||
->execute()
|
||
->fetch();
|
||
->setMaxResults(1);
|
||
// $this->id always points to the ID of the default language page, so we check
|
||
// sys_language_uid to determine if we need to fetch a translation
|
||
if (array_key_exists('L', $_GET) && (int)$_GET['L'] > 0) {
|
||
$pageUid = $this->id;
|
||
if ($field === 'alias') {
|
||
$pageUid = (int)$queryBuilder->execute()->fetchColumn(0);
|
||
}
|
||
$queryBuilder
|
||
->resetQueryPart('from')
|
||
->from('pages_language_overlay')
|
||
->where(
|
||
$queryBuilder->expr()->eq(
|
||
'pid',
|
||
$queryBuilder->createNamedParameter($pageUid, \PDO::PARAM_INT)
|
||
),
|
||
$queryBuilder->expr()->eq(
|
||
'sys_language_uid',
|
||
$queryBuilder->createNamedParameter(
|
||
(int)$_GET['L'],
|
||
\PDO::PARAM_INT
|
||
)
|
||
)
|
||
);
|
||
}
|
||
$page = $queryBuilder->execute()->fetch();
|
||
$workspace = $this->whichWorkspace();
|
||
if ($workspace !== 0 && $workspace !== false) {
|