Project

General

Profile

Bug #83586 » PageLayoutView.patch

TYPO3 Version 8.7.9: typo3/sysext/backend/Classes/View/PageLayoutView.php - Michael Schütz, 2018-01-18 15:06

View differences:

typo3/sysext/backend/Classes/View/PageLayoutView.php
$this->contentElementCache[$lP] = [];
}
if (count($langListArr) === 1 || $lP === 0) {
$showLanguage = $expressionBuilder->in('sys_language_uid', [$lP, -1]);
if ($GLOBALS['BE_USER']->workspace) {
// if we are in workspace we have to select records of all languages
$allLanguageIds = [-1 => -1, 0 => 0];
foreach(BackendUtility::getRecordsByField('sys_language', 'hidden' , 0) as $key => $langValues) {
$allLanguageIds[$langValues['uid']] = $langValues['uid'];
}
$showLanguage = $expressionBuilder->in('sys_language_uid', $allLanguageIds);
} else {
$showLanguage = $expressionBuilder->eq('sys_language_uid', $lP);
}
if (count($langListArr) === 1 || $lP === 0) {
$showLanguage = $expressionBuilder->in('sys_language_uid', [$lP, -1]);
} else {
$showLanguage = $expressionBuilder->eq('sys_language_uid', $lP);
}
}
$cList = explode(',', $this->tt_contentConfig['cols']);
$content = [];
$head = [];
// Select content records per column
$contentRecordsPerColumn = $this->getContentRecordsPerColumn('table', $id, array_values($cList), $showLanguage);
// Here we have to remove overlayed records which don't belong to current language
// 1.) record has to be workspace-overlayed
// 2.) then check if overlayed record belongs to current loop-language "$lP"
// 3.) if not remove record from $contentRecordsPerColumn
if ($GLOBALS['BE_USER']->workspace) {
foreach($contentRecordsPerColumn as $columnId => $records) {
foreach($records as $key => $record) {
// 1.) record has to be workspace-overlayed
BackendUtility::workspaceOL($table, $record, $GLOBALS['BE_USER']->workspace);
// 2.) then check if overlayed record belongs to current loop-language "$lP"
if ($record['sys_language_uid'] != $lP) {
// 3.) if not remove record from $contentRecordsPerColumn
unset($contentRecordsPerColumn[$columnId][$key]);
}
}
}
}
// For each column, render the content into a variable:
foreach ($cList as $columnId) {
if (!isset($this->contentElementCache[$lP][$columnId])) {
(6-6/6)