[TYPO3-dev] Replacement for loadTCA

Christian Kuhn lolli at schwarzbu.ch
Wed Sep 11 20:45:03 CEST 2013


Hey,

On 09/11/2013 01:49 PM, Tom Peters wrote:
> I'm trying to build a new Content Extension in Typo3 6.2.
> I got trouble to update the TCA[tt_content][types][pluginname][showitem] without using the deprecated "loadTCA".
> If the item TCA[tt_content][types][pluginname] is set I'm able to use "addToAllTCAtypes('tt_content', $showitemtext, 'pluginname')".
> Is there a good way to set TCA[tt_content][types][pluginname] without using "loadTCA"?

addToAllTCAtypes() works exactly as before.

You can just remove all loadTCA() calls, there is no substitution. With 
6.1, TCA is always fully loaded, the need to call loadTCA() is gone.

Beside the removal of loadTCA(), there is another neat improvement: If 
defining TCA for a new table, the whole TCA array is in one file now, so 
'ctrl' section and 'columns' are now combined. See [1] for documentation 
and see core extensions for examples [2] [3]. This way, you don't need 
this weird "dynamicConfigFile" construct anymore. Adding a file named 
like your db-table to Configuration/TCA in your extension that returns 
the full TCA array of this table does the job, it will be automatically 
loaded by the system.

You only need to call API methods of 
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility like 
addToAllTCAtypes() if you add fields or need to mangle TCA of existing 
tables in ext_tables.php, just like before. If changing TCA of a table 
that a different extension defines in the first place, you only need to 
take care that the extension defining the main table is registered in 
LocalConfiguration extListArray() *before* your extending extension. 
This is also identical to the previous behaviour.

As usual, this stuff is fully backwards compatible, you could still use 
the old scheme with ctrl section in ext_tables and the rest in some 
tca.php file or something, if you need to stay compatible with older 
core versions. You can also still call loadTCA(), it is just deprecated 
and the method itself is empty (it does nothing) because the TCA loading 
is always done during bootstrap.

Regards
Christian

[1] http://docs.typo3.org/typo3cms/TCAReference/WhatIsTca/Index.html
[2] system extension sys_note: 
typo3/sysext/sys_note/Configuration/TCA/sys_note.php
[3] system extension core: typo3/sysext/core/Configuration/TCA/



More information about the TYPO3-dev mailing list