Bug #95390
closedTCEFORM.pages.layout does not allow adding items with integer "names"
0%
Description
In TYPO3 v10 there is only one select-entry on page-edit > Appearance > Frontend Layout [layout] called "Default [0]".
In prior versions it was possible to add new select-entries with this TSConfig:
TCEFORM {
pages {
layout {
altLabels.0 = Default-Renamed
addItems.1 = Test-1
addItems.test2 = Test-2
}
}
}
However that does't work anymore. With this code, the default entry is successfully renamed to "Default-Renamed". The "Test-1" entry does not show up at all, but IMO this was the former expected valid statement. Instead, "Test-2" shows, but can't be selected because the database field-definition for pages.layout is set to INTEGER (storing the string-value resets the field to 0).
Not sure what will be the fix here: maybe the database-migration script should set pages.layout to VARCHAR as well like for the other layout-fields, e.g. pages.backend_layout and tt_content.layout ?
TYPO3 v10.4.21
Updated by Bastian Stargazer about 3 years ago
Sorry, my mistake. The bootstrap_package removes the items 1, 2 and 3, haven't seen that.
But it's still a bit strange why the items can't be re-added if the removeItems TSconfig is loaded first, and the addItems TSconfig later.
Workaround: start using addItems.4 and higher works.
Updated by Oliver Bartsch about 3 years ago
- Status changed from New to Needs Feedback
Hi,
the reason is: FormEngine evaluates addItems
before removeItems
(see: https://github.com/TYPO3/typo3/blob/master/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php#L74). The extension loading order is therefore irrelevant in this case.
A workaround could be to "unset" the removeItems
config from the 3rd party extension in your own TSconfig.
Updated by Bastian Stargazer about 2 years ago
Sorry for my late reply. Unsetting/overwriting prior set removeItems
first and than using altLabels
to rename e.g. 1 and 2 works, thank you for the tip!
Can be closed.
Updated by Oliver Bartsch about 2 years ago
- Status changed from Needs Feedback to Closed
Closed as requested by the author.