Review main Merged

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

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

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
    • Garvin Hicking +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Garvin Hicking +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 913

  1. Stefan Bürk uploaded patch set 1 06/16/25, 08:11

  2. core-ci voted on patch set 1 V +1 06/16/25, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80369

  3. Oliver Klee updated the commit message in patch set 2 V +1 06/16/25, 09:11

  4. core-ci voted on patch set 2 V +1 06/16/25, 09:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80375

  5. Stefan Bürk updated the commit message in patch set 3 V +1 06/16/25, 11:31

  6. core-ci voted on patch set 3 V +1 06/16/25, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80379

  7. Oliver Klee updated the commit message in patch set 4 V +1 06/16/25, 12:28

  8. core-ci voted on patch set 4 V +1 06/16/25, 12:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80382

  9. Christian Kuhn voted on patch set 4 CR +1 V +1 06/17/25, 08:56

  10. Garvin Hicking voted on patch set 4 CR +1 V +1 06/17/25, 10:28

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

  12. Stefan Bürk merged patch set 5 06/17/25, 11:06

  13. Benni Mack commented on patch set 5 06/17/25, 20:29

    I wonder how this could happen in the first place, but this mitigation smells a bit fishy to me, as I would like to understand how this could happen in the first place. We do have some interesting TcaInline issues indeed but I hope to dig deeper in this once I'm back from vacation... I just wanted to mention this so I can pick it up again.