Project

General

Profile

Actions

Bug #95390

closed

TCEFORM.pages.layout does not allow adding items with integer "names"

Added by Bastian Stargazer over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-09-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

Updated by Bastian Stargazer over 2 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.

Actions #2

Updated by Oliver Bartsch over 2 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.

Actions #3

Updated by Bastian Stargazer over 1 year 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.

Actions #4

Updated by Oliver Bartsch over 1 year ago

  • Status changed from Needs Feedback to Closed

Closed as requested by the author.

Actions

Also available in: Atom PDF