diff --git a/typo3/sysext/recordlist/Classes/Controller/RecordListController.php b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php index cd27d53314fac0ecc2ebba531366c0396392d958..da0ddb6dea4522af449a2af526c4c6886486638c 100644 --- a/typo3/sysext/recordlist/Classes/Controller/RecordListController.php +++ b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php @@ -418,6 +418,7 @@ class RecordListController $pageTranslationsDatabaseRecordList->deniedNewTables = ['pages']; $pageTranslationsDatabaseRecordList->hideTranslations = ''; $pageTranslationsDatabaseRecordList->iLimit = $pageTranslationsDatabaseRecordList->itemsLimitPerTable; + $pageTranslationsDatabaseRecordList->setLanguagesAllowedForUser($this->siteLanguages); $pageTranslationsDatabaseRecordList->showOnlyTranslatedRecords(true); $output .= $pageTranslationsDatabaseRecordList->getTable('pages', $this->id); } diff --git a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php index 22709fe60d8e47323e6011339972be0d0eb50f07..4c63225537df01bf8f074762a007d811816a474e 100644 --- a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php @@ -586,6 +586,13 @@ class DatabaseRecordList */ protected $systemLanguagesOnPage; + /** + * All languages that are allowed by the user + * + * @var array + */ + protected $languagesAllowedForUser = []; + /** * Constructor */ @@ -901,6 +908,11 @@ class DatabaseRecordList } $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this); } + + if ($table == 'pages' && $this->showOnlyTranslatedRecords) { + $addWhere .= ' AND ' . $GLOBALS['TCA']['pages']['ctrl']['languageField'] . ' IN(' . implode(',', array_keys($this->languagesAllowedForUser)) . ')'; + } + $additionalConstraints = empty($addWhere) ? [] : [QueryHelper::stripLogicalOperatorPrefix($addWhere)]; $selFieldList = GeneralUtility::trimExplode(',', $selFieldList, true); @@ -4086,4 +4098,14 @@ class DatabaseRecordList { return $GLOBALS['LANG']; } + + /** + * @param array $languagesAllowedForUser + * @return DatabaseRecordList + */ + public function setLanguagesAllowedForUser(array $languagesAllowedForUser): DatabaseRecordList + { + $this->languagesAllowedForUser = $languagesAllowedForUser; + return $this; + } }