Closed LeoniePhiline closed 2 weeks ago
@simonschaufi // @sabbelasichon Here it is kinda the question what we want to do. Basically the original config is wrong, that's why the items config gets killed. Should we still check for this and prevent a removal?
In which way is the original config wrong?
To me, it appears to match the TYPO3 10 example at https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/checkDefault.html#examples
I do see that the checkbox toggle examples show empty labels https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/checkboxToggle.html#examples
However, the label is displayed, and checkbox toggles with non empty label and empt value can also be found in TYPO3 10 core.
Non-empty labels, and labels with implicit numeric keys, are also shown in https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/checkboxToggle.html#items
Minimal PHP Code Causing Issue
Applied rules
SimplifyCheckboxItemsTCARector
Expected Behaviour
Note: Manually changing
['LLL:EXT:some_extension/Resources/Private/Language/locallang_db.xlf:some_label', '']
to[0 => 'LLL:EXT:some_extension/Resources/Private/Language/locallang_db.xlf:some_label']
preventsSimplifyCheckboxItemsTCARector
from triggering and falsely removing the label.Package Version
2.6.4
PHP Version
8.3.10
TYPO3 Version
11.5.38
Notes
Actual behavior:
The
['items'][...][0]
label gets lost even if it is non-empty. Docs: https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Check/Toggle.html#tca_example_checkbox_17Later, for TYPO3 12, the
0 =>
will be translated into'label' =>
. Docs: https://docs.typo3.org/m/typo3/reference-tca/12.4/en-us/ColumnsConfig/Type/Check/Toggle.html#columns-check-checkboxToggle-examples-17