Issue Bug Closed

#106917First save of table field fails when delimiter field is missing

Christian Weiske 06/20/25, 13:52 updated 12/02/25, 14:22

Description

Prerequisite: “Table” content element with a text field that has renderType = textTable but without a table_delimiter field.

Saving such a table element the first time causes all columns to be merged into a single cell with a broken separator: ab.

This happens on TYPO3 v12.4.33 and TYPO3 v13.4.14

Steps to reproduce

  1. Normal table content element shipped with TYPO3 core must be available
  2. Remove the table_delimiter from the element (to reduce cognitive load for editors) by overriding TCA in e.g. Configuration/TCA/Overrides/tt_content.php: $GLOBALS['TCA']['tt_content']['palettes']['tableconfiguration']['showitem'] = 'table_enclosure';
  3. Web > Page: Create new content element “Table”
  4. Add a second column
  5. Type “a” in first column, “b” in second
  6. Save

The element will be saved, but the table wizard will show a single field only, with values “a b”. Between a and b is a broken non-displayable character.

When adding a second column again and saving again, all is fine.

Impact

This also happens when creating custom content elements with flux or mask that don’t have a delimiter field by default.

Cause

TYPO3\CMS\Backend\Form\Element\TextTableElement::getTableWizard() is the source of the problem. It checks if a delimiter is configured with this code:

$delimiter = ($row['table_delimiter'][0] ?? false) ? chr((int)$row['table_delimiter'][0]) : '|';

This is fine as long as a table_delimiter field is defined, because then databaseRow[table_delimiter] is an array:

["table_delimiter"]=> array(1) { [0]=> string(3) "124" }

When the content element does not have this field, databaseRow[table_delimiter] is a string:

["table_delimiter"]=> string(3) "124"

The array key check $row['table_delimiter'][0] does a substr in this case, returning “1” as ASCII number code for the delimiter. This leads to the broken delimiter character later on.

When saving this element a second time, table_delimiter is an integer now:

["table_delimiter"]=> int(124)

A [0] access does not do a substring now but fails, leading to the fallback delimiter value “|”.

Reviews 3

History 610

  1. Christian Weiske commented <span data-processor="relativetime" data-value="2025-06-20T15:55:30+00:00" > 06/20/25, 15:55 </span>

    Garvin Hicking wrote in #note-2:
    > Is https://forge.typo3.org/issues/106193 related to this maybe in some regard?

    No, it’s a different problem.

  2. Anonymous commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-07-24T15:20:08+00:00" > 07/24/25, 15:20 </span>

    Applied in changeset commit:34f419120febd334449fcc2166551a9360687d25.

  3. Gerrit Code Review pushed patch set 1 for 12.4 to change 90412 status Resolved Under Review <span data-processor="relativetime" data-value="2025-08-15T12:54:03+00:00" > 08/15/25, 12:54 </span>

  4. Anonymous commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2025-08-15T13:25:09+00:00" > 08/15/25, 13:25 </span>

    Applied in changeset commit:461baed0ff102e095ce0a2cc0aed8366acec42a6.