Project

General

Profile

Actions

Bug #96560

closed

Wrong sorting of rows in backend layout in TYPO3 11.5

Added by Felix Heller almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2022-01-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

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.

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.


Files

Actions

Also available in: Atom PDF