Issue Bug Closed

#107304FlexForm TcaMigration: PHP warning for empty <items>

Christian Weiske 08/18/25, 05:52 updated 12/02/25, 13:58

Description

I get a PHP Warning when there is a flexform with an empty config.items field:

typo3/sysext/core/Classes/Configuration/Tca/TcaMigration.php:1393
foreach() argument must be of type array|object, string given

We’re using itemsProcFunc to fill in select items, and only have an XML comment as reminder:

<config>
    <type>select</type>
    <itemsProcFunc>Mogic\Lde\Blog\Ui\Config\Flexform\BlogProcFunc->pageIds</itemsProcFunc>
    <renderType>selectSingle</renderType>
    <items>
        <!-- empty by default -->
    </items>
    <eval>required</eval>
</config>

The FlexForm parser doesn’t find any child tags in <items> and so uses the string value (minus the comment) as value for items.

TCA migration migrateItemsToAssociativeArray does not check if items is an array and throws a warning.

This happens in TYPO3 v12.4.30 and also main.

Reviews 2

History 26

  1. Gerrit Code Review pushed patch set 1 for main to change 90429 status New Under Review 08/18/25, 05:58

  2. Gerrit Code Review pushed patch set 2 for main to change 90429 08/18/25, 08:12

  3. Gerrit Code Review pushed patch set 3 for main to change 90429 08/18/25, 08:32

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 90431 08/18/25, 11:47

  5. Anonymous commented and changed status Under Review Resolved done 0 % 100 % 08/18/25, 11:50

    Applied in changeset commit:004fbcf0f4dd73bac277d95673dd3c3dd3b73964.

  6. Benni Mack changed status Resolved Closed 12/02/25, 13:58