Bug #94029
closedTCA columnsOverrides does not work for all labels
0%
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
.
Updated by Benni Mack over 3 years ago
- Related to Bug #91450: TCA columnsOverrides don't work for label added
Updated by Oliver Bartsch over 3 years ago
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.
Updated by Jens no-lastname-given over 3 years ago
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
Updated by Oliver Bartsch about 3 years ago
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?
Updated by Stefan Froemken over 1 year ago
- 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
Updated by Jens Hoppe over 1 year ago
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
Updated by Stefan Froemken about 1 year ago
Hi Jens,
I have updated my answer a little bit (add priority to my ordered list)
Stefan