Issue Bug Closed

#106042Exception in TypoScript module with pid = 0

Jan Delius 01/31/25, 13:50 updated 12/02/25, 14:26

Description

An exception is thrown in the ‘TypoScript’ backend module if there is a sys_template entry with pid = 0.

While this error is only displayed on the corresponding page in the page tree in v11, the module is unusable in v12.

This is due to a line that fetches the current element of an array and then checks it without checking whether there is an element at all: https://github.com/TYPO3/typo3/blob/5dc6d2180eb2d3a90469d50c4baa9aa6760904c5/typo3/sysext/tstemplate/Classes/Controller/TemplateRecordsOverviewController.php#L127

Outside of this function, nothing is called if the root line is empty. Here, however, it is only made empty in the statement above it, which means that the condition does not apply.

Even if there should be no sys_templates on pid 0, in the current case this is probably due to an outdated data status and should not make the backend module unusable.

clipboard-202501311450-9m5cb.png

Reviews 3

Files 1

History 47

  1. Garvin Hicking changed category 01/31/25, 13:58

  2. Christian Kuhn commented 01/31/25, 14:02

    confirmed. sys_template records shouldn’t be on pid 0. but still, we should sanitize this. will fix.

  3. Gerrit Code Review pushed patch set 1 for main to change 87964 status New Under Review 01/31/25, 14:11

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 87965 01/31/25, 14:52

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 87966 01/31/25, 14:53

  6. Christian Kuhn commented and changed status Under Review Resolved done 0 % 100 % 01/31/25, 15:10

    Applied in changeset commit:89111c84357e57556f0211cc3cc47747f9470a4f.

  7. Benni Mack changed status Resolved Closed 12/02/25, 14:26