Issue Bug New Orphaned

#107148DataHandler value check does not consider overrideChildTca in fields of type inline

Thomas Prangenberg 07/25/25, 16:56 updated 08/18/25, 06:41

Description

When the DataHandler checks values and removes invalid values from the field array before updating the database row, it only checks against the TCA configuration of the original table. While it does respect column overrides of different types, it does not take into account that a configuration could have been altered in an inline context using overrideChildTca.

For example, say I have a table “foo” with a required “endtime” field:

Configuration/TCA/foo.php


'endtime' => [
  'exclude' => FALSE,
  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
    'config' => [
      'type' => 'datetime',
      'format' => 'datetime',
      'required' => TRUE,
      'size' => 20,
    ]
]

.. and another table “bar” with a field “foos” where I want to set required to false:

Configuration/TCA/bar.php

'foos' => [
  'config' => [
    'type' => 'inline',
    'foreign_table' => 'foo',
    'foreign_field' => 'bar',
    'overrideChildTca' => [
      'columns' => [
        'endtime' => [
          'config' => [
            'required' => FALSE
          ]
        ]
      ]
    ]
]

Expected result would be that now the field in the inline records of type “foo” within “bar” are no longer required and can be left empty.

Actual behaviour:

This works in regards of form rendering and client side validation. You can leave the fields empty and the record can be saved.
However, if you have set a value and then try to remove it by emptying the “endtime” field, then after saving, the previous value will remain unchanged. You can overwrite it with another value but not empty.

I’ve digged a bit deeper in the DataHandler class and it seems that this happens because \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_SW checks the input values against the TCA configuration of the table and removes invalid values.

I would guess that to fix this, \TYPO3\CMS\Core\DataHandling\DataHandler::resolveFieldConfigurationAndRespectColumnsOverrides would have to be changed in a way that also respects inline contexts, because right now it only gets its configuration from the current table itself.

My workaround right now is to just use another type explicitly for that use case in the original table and use columnsOverrides in the type configuration. That limits the types usable in the inline field though.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] DataHandler value check does not consider overrideChildTca in fields of type inline Resolves: #107148 Releases: main