#96560Wrong sorting of rows in backend layout in TYPO3 11.5
Description
If you reuse an existing backend layout and modify it in Page TSconfig, then the rows were sorted correctly by its index number in TYPO3 10.4. In TYPO3 11.5, this doesn’t work any more.
Example page TSconfig
mod.web_layout.BackendLayouts {
Test {
title = Test
config.backend_layout {
colCount = 1
rowCount = 1
rows {
1.columns.1 {
name = Content
colPos = 0
}
}
}
}
TestII < .Test
TestII {
title = Test II
config.backend_layout {
rowCount = 2
rows {
2 < .1
1 >
1.columns.1 {
name = Header
colPos = 1
}
}
}
}
}
This results in a PageTSconfig array like this:
[
'2' => [
'colPos' => 0,
'name' => 'Content',
],
'1' => [
'colPos' => 1,
'name' => 'Header',
],
];
In TYPO3 10.4, the backend layout is rendered in \TYPO3\CMS\Backend\View\PageLayoutView in the method public function getTable_tt_content($id):
for ($row = 1; $row <= $rowCount; $row++) {
$rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
With this for loop, the first row is the “Header” row and the second row is the “Content” row.
test-backendlayout-sort-10-4.png
In TYPO3 11.5, the backend layout is rendered in \TYPO3\CMS\Backend\View\Drawing\BackendLayoutRenderer in the method public function getGridForPageLayoutContext(PageLayoutContext $context): Grid:
foreach ($context->getBackendLayout()->getStructure()['__config']['backend_layout.']['rows.'] ?? [] as $row) {
$rowObject = GeneralUtility::makeInstance(GridRow::class, $context)
With this foreach loop, the first row is the “Content” row and the second row is the “Header” row. This ignores that the “Header” row has the lower index key in the page TSconfig.
test-backendlayout-sort-11-5.png