Issue Bug Closed

#89192TypoScript multi-line value syntax in is broken in Backend Layout

Sebastian Michaelsen 09/17/19, 18:06 updated 07/24/24, 05:28

Description

Consider the following Backend Layout:

mod.web_layout.BackendLayouts.infoPage {
  title = Info Page
  config.backend_layout {
    colCount = 1
    rowCount = 1
    rows {
      1.columns.1 {
        name = Content Area
        colPos = 0
        allowed.CType (
          gridelements_pi1,
          list,
          shortcut,
          text,
        )
      }
    }
  }
}

The multi-line value for allowed.CType is perfectly valid and correctly parsed by TYPO3. However \TYPO3\CMS\Backend\Provider\PageTsBackendLayoutDataProvider->generateBackendLayoutFromTsConfig tries to reconstruct the original TSconfig from the parsed array and assumes all values are one-line values with = syntax.

The reconstructed TSconfig then looks like this (in Xdebug)

backend_layout.colCount = 1
backend_layout.rowCount = 1
backend_layout.rows.1.columns.1.name = Content Area
backend_layout.rows.1.columns.1.colPos = 0
backend_layout.rows.1.columns.1.allowed.CType =           gridelements_pi1,
          list,
          shortcut,
          text

Resulting in only gridelements_pi1 to be allowed.

A possible solution could be to strip all line breaks while reconstructing the TSconfig.

Workaround: Do not use the multi-line value syntax in Backend Layouts.

This affects at least TYPO3 8 to 10.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.