Project

General

Profile

Actions

Bug #91450

closed

TCA columnsOverrides don't work for label

Added by Christian Hackl almost 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-20
Due date:
% Done:

0%

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

Description

In the example below (TCA => customExt/Configuration/TCA/Overrides/tt_content.php), the "label" field within "columnsOverrides" is ignored, while the "config" array works.
The PageTs example works well too.

$colpreviewTypes = [
    'myCustomType' => [
        'showitem' => '
            ...,
            space_after_class,
            ...,
        ',
        'columnsOverrides' => [
            'space_after_class' => [
                'label' => 'Columns header size',
                'config' => [
                    'type' => 'input',
                    'renderType' => 'colorpicker',
                    'size' => 10,
                ],
            ],
        ],
    ],
];
$GLOBALS['TCA']['tt_content']['types'] += $colpreviewTypes;
TCEFORM {
    tt_content {
        space_after_class.types {
            myCustomType.label = testing
        }
    }
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #94029: TCA columnsOverrides does not work for all labelsClosedStefan Froemken2021-04-30

Actions
Actions #1

Updated by Oliver Bartsch almost 4 years ago

  • Status changed from New to Needs Feedback

Hi, based on your example I tried to reproduce this with latest master (10.4.4-dev) but everything seems to work fine.

That's my configuration:

<?php
// typo3conf/ext/<ext_key>/Configuration/TCA/Overrides/tt_content.php

$colpreviewTypes = [
    'customtype' => [
        'showitem' => 'space_before_class',
        'columnsOverrides' => [
            'space_before_class' => [
                'label' => 'custom label'
            ]
        ]
    ]
];

$GLOBALS['TCA']['tt_content']['types'] += $colpreviewTypes;

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    ['Custom type', 'customtype']
);

You may want to try this example in your codebase. Furthermore if the bug persists, please have a look in the configuration module, if your configuration is recognised there. If you see the configuration there but still don't see your overwritten label in FormEngine, a more detailed configuration might help.

Actions #2

Updated by Georg Ringer over 3 years ago

  • Status changed from Needs Feedback to Closed

closing this issue because of lack of feedback

Actions #3

Updated by Christian Ehret over 3 years ago

I ran into the same issue today

I tried to change the bodytext label. I can change the field to an input field, but I cannot change the label:

custom_ext/Configuration/TCA/Overrides/tt_content.php looks like this:


$GLOBALS['TCA']['tt_content']['types']['customext_test'] = [
    'showitem' => '
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
            --palette--;;general,
            --palette--;;headers,
            bodytext;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel,
        --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
            --palette--;;frames,
            --palette--;;appearanceLinks,
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
            --palette--;;language,
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
            --palette--;;hidden,
            --palette--;;access,
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
            categories,
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
            rowDescription,
        --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
    ',
    'columnsOverrides' => [
        'bodytext' => [
            'label' => 'LLL:EXT:custom_ext/Resources/Private/Language/backend.xlf:test.title',
            'config' => [
                'type' => 'input',
                'size' => 30,
                'max' => 255,
            ],
        ],
    ],
];

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
    'tt_content',
    'CType',
    [
        'LLL:EXT:custom_ext/Resources/Private/Language/backend.xlf:test.title',
        'customext_test',
        'content-test',
    ],
    'textmedia',
    'after'
);

Actions #4

Updated by Christian Hackl over 3 years ago

sry for my late response,

with TYPO3 8.7.31 this works:

$tempTypes =[
    'custom_type' => [
        'columnsOverrides' => [
            'assets' => [
                'label' => 'Hintergrundbild (1920 x min.1100px)',
            ],
            'image' => [
                'label' => 'Bild für Mobile Ansicht (unterhalb der Tage)',
            ],
        ],
        'showitem' => 'assets,image',
    ],
];
$GLOBALS['TCA']['tt_content']['types'] += $tempTypes;
Actions #5

Updated by Christian Ehret over 3 years ago

Christian Hackl wrote:

sry for my late response,

with TYPO3 8.7.31 this works:

[...]

Thank you Christian for your response. I use 10 LTS....

Actions #6

Updated by Jens Hoppe almost 3 years ago

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 just tested this in 10.4.15. 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. Therefore the following does not work:

$GLOBALS['TCA']['tt_content']['types']['menu_pages']['columnsOverrides'] = [
    'pages' => [
        'label' => 'myBrilliantLabel',
    ],
];

What does work for the same element though is this:

$GLOBALS['TCA']['tt_content']['types']['menu_pages']['columnsOverrides'] = [
    'rowDescription' => [
        'label' => 'myBrilliantLabel'
    ],
];

The only difference is that rowDescription does not get an individual label in menu_pages.showitem.

Actions #7

Updated by Benni Mack almost 3 years ago

  • Related to Bug #94029: TCA columnsOverrides does not work for all labels added
Actions

Also available in: Atom PDF