josias
josias

Reputation: 1626

TYPO3: Override $GLOBALS['TCA'] with a function

In my extension I use an tablename.php file inside the tca/override folder to override some stuff defined by another extension. I know I can do this:

$GLOBALS['TCA']['tablename']['columns']['anoption']['config']['minitems'] = 1;

But when the original file says:

... 'anoption''config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
        'anoption',
        ['maxitems' => 7,]

What will be the override syntax? I was trying something like:

$GLOBALS['TCA']['tablename']['columns']['anoption']['config']['anoption']['maxitems'] = 3;

But that doesn't work and I don't know what I have to insert after config since in the original file there is that getFileTCAConfig function.

Also I was wondering how I could debug "$GLOBALS['TCA']['tablename']['columns']['anoption']" to somehow see all the suboptions, since I did not find anything inside the mysql database, I couldn't read any config from the phpMyAdmin.

I appreciate all the help!

Upvotes: 1

Views: 1306

Answers (1)

Mathias Brodala
Mathias Brodala

Reputation: 6480

You can debug the final TCA in the TYPO3 backend through the Configuration module in the System section. Once you open that module you select $GLOBALS['TCA'] (Table configuration array) in the topmost function select box:

enter image description here

Upvotes: 6

Related Questions