Review 13.4 Merged

89741[BUGFIX] Mitigate TypeError in FormEngine DataProvider `TcaInline`

Stefan Bürk CR +2 V +2 Easy +1 −1 updated 06/17/25, 11:07

Commit message

With #104584 the one or other native types has been added to
`\TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline` methods,
leading to issues in calling paths for TCA type=inline fields
with `foreign_table` configuration.

Configuration like following:

    'tx_myext_entities' => [
        'exclude' => true,
        'label' => $ll('pages.tx_academiccontacts4pages_contacts'),
        'l10n_mode' => 'exclude',
        'config' => [
            'type' => 'inline',
            'appearance' => [
                'collapseAll' => true,
                'expandSingle' => false,
                'showNewRecordLink' => true,
                'newRecordLinkAddTitle' => true,
                'levelLinksPosition' => 'top',
                'useCombination' => false,
                'suppressCombinationWarning' => false,
                'useSortable' => true,
                'showPossibleLocalizationRecords' => false,
                'showAllLocalizationLink' => false,
                'showSynchronizationLink' => false,
                'enabledControls' => [
                    'info' => true,
                    'new' =>  true,
                    'dragdrop' => true,
                    'sort' => false,
                    'hide' => true,
                    'delete' => true,
                    'localize' => true,
                ],
                'showPossibleRecordsSelector' => false,
                'elementBrowserEnabled' => false,
            ],
            'enableCascadingDelete' => true,
            'foreign_field' =>  'page',
            'foreign_sortby' => 'sorting',
            'foreign_table' => 'tx_myext_domain_model_entity',
        ],
    ],

requires `nullable integer` database fields as for the column
`tx_myext_entities` in the table as it is a counter field due
to relation handling.

`l10n_mode=exclude` means that the field is not translated and
does not have a default language row during page localization,
trying to pass array value `NULL` as 4th argument to the method
`TcaInline::resolveConnectedRecordUids()` expecting `string`,
leading to the TypeError.

This change adds a string cast combined with null-coalesce fallback
to the call as a bugfix to restore non-crashing state as bugfix,
mitigating the introduced regression based on adding native types.

Long term it should be investigated if calling the method make
sense at all or should be early prevented.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 2

Files 1

Review log 34

  1. Stefan Bürk commented on patch set 1 06/17/25, 10:57

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 06/17/25, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80421

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 06/17/25, 11:06

  4. Stefan Bürk merged patch set 2 06/17/25, 11:07