Bug #92285
openTCA type group with multiple enabled selects 2 elements at once
0%
Description
If you open the element browser and select one item it gets placed two times in the list.
Does not happen on current v11 branch.
Files
Updated by Daniel Siepmann over 3 years ago
Can confirm the issue.
Discovered it via https://github.com/FriendsOfTYPO3/legacy-collections which has the following TCA for a column:
'items' => [ 'label' => 'LLL:EXT:legacy_collections/Resources/Private/Language/locallang_tca.xlf:sys_collection.items', 'config' => [ 'type' => 'group', 'internal_type' => 'db', 'prepend_tname' => true, 'allowed' => '*', 'MM' => 'sys_collection_entries', 'MM_hasUidField' => true, 'multiple' => true, 'size' => 5 ] ],
Not sure what multiple should do, it is not mentioned for fields of type group at docs.typo3.org: https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/Group/Properties/Index.html
It either should do nothing, or also be added to docs.
Unsetting the property works (e.g. merge overwrite), setting to false does also work.
Looks like https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js#L130 is called twice. If multiple is true, it will execute twice. If it is false, it will not execute a 2nd time, as it checks for duplicates and stops.
First its called from https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js#L115, and then from https://github.com/TYPO3/TYPO3.CMS/blob/10.4/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js#L687.
Both are triggered from https://github.com/TYPO3/TYPO3.CMS/blob/10.4/Build/Sources/TypeScript/recordlist/Resources/Public/TypeScript/ElementBrowser.ts#L168.
Hope that helps to find the bug and bugfix.