#70081maxitems = 1 and e.g. category tree results in invalid itemFormElValue in SelectTreeElement
Description
In \TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems there is the following code:
// For single select fields we just keep the current value because the renderer
// will take care of showing the "Invalid value" text.
// For maxitems=1 select fields is is also possible to select empty values.
// @todo: move handling of invalid values to this data provider.
if ($fieldConfig['config']['maxitems'] === 1) {
return array($result['databaseRow'][$fieldName]);
}
However, that is actually invalid becasue even if I have maxitems === 1 I can still use MM relations like for categories which would then need to be resolved.
We need to check for MM table here.
Furthermore I think this issue is actually related:
https://forge.typo3.org/issues/69836
Becasue that way 0 was returned instead of “parsed” but once an item is stored it would always be “1” as the field only contains the count.