0

I customized the TCA of tt_address in my custom sitepackage. In EXT:my_package/Configuration/TCA/Overrides/tt_content.php I have this code, which works fine in the backend.

$GLOBALS['TCA']['tt_address']['types']['0'] = [
    'showitem' => '
        --palette--;LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address_palette.name;name,
        --palette--;LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address_palette.organization;organization,
        image,,
        --palette--;LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address_palette.address;address,        
        --palette--;LLL:EXT:tt_address/Resources/Private/Language/locallang_db.xlf:tt_address_palette.contact;contact,
        --palette--;;paletteHidden,    
        --div--;' . 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_category.tabs.category, categories        
    '    
];

$GLOBALS['TCA']['tt_address']['palettes'] = [
    'name' => [
        'showitem' => 'gender, title,,--linebreak--,
            first_name, , last_name,--linebreak--,
            name,'
    ],
    'address' => [
        'showitem' => 'address, zip, city'
    ],    
    'organization' => [
        'showitem' => 'company'
    ],
    'contact' => [
        
        'showitem' => 'phone, mobile, fax, --linebreak--,
        email,  www,'
    ], 
    'paletteHidden' => [
        'showitem' => 'hidden',
    ],
];

$GLOBALS['TCA']['tt_address']['ctrl'] = [
    'label' => 'company'
];

If I analyze the database structure, most of the tt_address fields will be renamed respectively removed. But not all fields are unused. As you can see above the hidden field (on palletteHidden) is used and I need it in a fluid condition. So I didn't apply the changes on the database.

enter image description here

What do I have to adjust so that the database analysis no longer wants to adjust the table tt_address and all fields are retained?

What do I have to adjust so that the database analysis no longer wants to adjust tt_address and all fields are retained

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Steffi
  • 27
  • 4

1 Answers1

0

Fields which should be added or dropped are identified by:

  • all combined ext_tables.sql files
  • dynamically fields which might be computed out of the $GLOBALS['TCA']['<tablename>']['ctrl'] section for fields like hidden, deleted, starttime, endttime, fe_group, ...
  • dynamically fields for category relations

I guess you are removing/overriding parts of the $GLOBALS['TCA']['<tablename>']['ctrl']

please check the configuration module to get some more hints.

Georg Ringer
  • 7,779
  • 1
  • 16
  • 34
  • Thanks for your feedback. I checked the configuration there is only one entry and this comes from my override in tt_content.php (name = company). If i remove my code from tt_content.php, the database analyzer shows nothing to rename/remove an all ctrl values form tt_conent are back in the configuration. do I have to set all ctrl values ​​in my tt_content so that I can overwrite the label? Thanks – Steffi Nov 30 '22 at 15:50
  • 1
    no, but I guess you override it wrong. So it might just need a $GLOBALS['TCA']['tt_address']['ctrl']['label'] = company In version 7 you ca override the used label fields via tsconfig https://docs.typo3.org/p/friendsoftypo3/tt-address/7.0/en-us/Configuration/TsConfig/Index.html#modify-record-label-in-backend – Georg Ringer Nov 30 '22 at 21:03
  • Obviously there is a difference between your code $GLOBALS['TCA']['tt_address']['ctrl']['label'] = company and my origin code $GLOBALS['TCA']['tt_address']['ctrl'] = [ 'label' => 'company' ]; – Steffi Dec 01 '22 at 08:16
  • with your code you reset the full ctrl and remove everything else - not something you want – Georg Ringer Dec 01 '22 at 09:06
  • 1
    I've learned that now :-) – Steffi Dec 01 '22 at 13:31