Project

General

Profile

Actions

Bug #96560

closed

Wrong sorting of rows in backend layout in TYPO3 11.5

Added by Felix Heller over 2 years ago. Updated over 1 year 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 #1

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #2

Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #3

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73054

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73056

Actions #6

Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #7

Updated by Gerrit Code Review about 2 years ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #8

Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73047

Actions #9

Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/73152

Actions #10

Updated by Georg Ringer about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF