#94029TCA columnsOverrides does not work for all labels
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.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 8
-
Benni Mack changed Related to #91450 05/10/21, 21:03
-
Oliver Bartsch commented 05/10/21, 21:34
-
Jens no-lastname-given commented 07/30/21, 13:38
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
-
Oliver Bartsch commented 11/16/21, 14:19
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? -
Benni Mack changed Sprint Focus On Location Sprint 08/02/23, 14:49
-
Stefan Froemken commented and changed category status
NewClosed assigned to Stefan Froemken 08/03/23, 19:38Hello 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
-
Jens Hoppe commented 08/07/23, 15:04
Hello Stefan!
> The process structure is:
>
> * TCA
> * columnsOverrides
> * showitem
> * pageTSconfigI 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 -
Stefan Froemken commented 09/22/23, 18:58
Hi Jens,
I have updated my answer a little bit (add priority to my ordered list)
Stefan
Hi, thanks for reporting.
The reason for this: In the
tcaDatabaseRecordFormDataGroup, theTcaColumnsOverridesprovider is called before theTcaColumnsProcessFieldLabelsprovider. Latter extracts and adds the label fromshowitemtocolumns>label.Because the
TcaColumnsProcessFieldLabelsprovider is callingsetLabelFromPageTsConfig()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;labelsyntax fromshowitemwould be the best solution, since it’s already possible to define a custom label for a specific record type in multiple other ways.