Bug #94029
closed
TCA columnsOverrides does not work for all labels
Added by Jens Hoppe over 3 years ago.
Updated about 1 year ago.
Category:
FormEngine aka TCEforms
Sprint Focus:
On Location Sprint
Description
The bug probably relates to the closed issue #91450.
columnsOverrides
works for labels of fields that were defined in TCA with tablename.fieldname.label
. It does not seem to work if the field was added with an inidividual label in showitem
like fieldname;label
.
I tested this in 10.4.15 with CType = menu_pages
. The field pages
is defined in frontend/Configuration/TCA/tt_content.php
with the label LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.startingpoint
. It is later added to menu_pages.showitem
with a different label though: pages;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:pages.ALT.menu_formlabel
. The following does not work:
$GLOBALS['TCA']['tt_content']['types']['menu_pages']['columnsOverrides'] = [
'pages' => [
'label' => 'myBrilliantLabel',
],
];
An example that does work for the same CType
is this:
$GLOBALS['TCA']['tt_content']['types']['menu_pages']['columnsOverrides'] = [
'rowDescription' => [
'label' => 'myBrilliantLabel'
],
];
The only difference seems to be that rowDescription
does not get an individual label in menu_pages.showitem
.
- Related to Bug #91450: TCA columnsOverrides don't work for label added
Hi, thanks for reporting.
The reason for this: In the tcaDatabaseRecord
FormDataGroup, the TcaColumnsOverrides
provider is called before the TcaColumnsProcessFieldLabels
provider. Latter extracts and adds the label from showitem
to columns>label
.
Because the TcaColumnsProcessFieldLabels
provider is calling setLabelFromPageTsConfig()
after the showitem evaluation, it's still possible to overwrite the label with TSconfig, e.g. TCEFORM.tt_content.pages.types.menu_pages.label = myBrilliantLabel
.
I'm currently not sure whether this is actually a bug. Maybe removing the field;label
syntax from showitem
would be the best solution, since it's already possible to define a custom label for a specific record type in multiple other ways.
I have the same problem with plugin:
$GLOBALS['TCA']['tt_content']['types']['list']['columnsOverrides'] = [
'header' => [
'label' => 'myBrilliantLabel',
'config' => [
'max' => 2,
],
],
];
config works, label does not work
Hi, the reason, why the label is not working, is explained in my last comment. As mentioned, you can use e.g. page TSconfig to set the label instead: TCEFORM.tt_content.header.types.list.label = myBrilliantLabel
. Does this solve your issue?
- Sprint Focus set to On Location Sprint
- Category set to FormEngine aka TCEforms
- Status changed from New to Closed
- Assignee set to Stefan Froemken
Hello Jens,
thank you for providing that issue. I have discussed that issue with TYPO3 Core members here on DevDays in Karlsruhe.
The process structure is:
- TCA (lowest PRIO)
- columnsOverrides
- showitem
- pageTSconfig (highest PRIO)
So it works like expected. Please override the label by replacing the LLL value in showitem section or by pageTSconfig.
I will close the ticket now. If you feel this is the wrong decision, let me know, and I will re-open it.
Stefan
Hello Stefan!
The process structure is:
- TCA
- columnsOverrides
- showitem
- pageTSconfig
I think it rather means that the process structure is in the wrong order. As I can still overwrite the label using TSconfig I do not consider this to be much of an actual issue though.
I will close the ticket now.
Ok.
Cheers
Jens
Hi Jens,
I have updated my answer a little bit (add priority to my ordered list)
Stefan
Also available in: Atom
PDF