[TYPO3-dev] sys_categories: API conflicts with core

André Spindler typo3 at andre-spindler.de
Wed Sep 3 15:23:14 CEST 2014


Hi Francois,

If I put the makeCategorizable() into my TCA file, the TCA definition for my table has to exist before.
Because makeCategorizable() only sets some fields. But I defineand return (afterwards) the main parts TCA for my table - does this work?
As far as I know, the TCA definition must exist before adding categories.

Unfortunately I haven't found a working example.
I wasn't able to find out how the category selector is added to pages and tt_content anyway.
And tx_news has a completely handmade definition for ist category field.

Regards,
André


-----Ursprüngliche Nachricht-----
Von: typo3-dev-bounces at lists.typo3.org [mailto:typo3-dev-bounces at lists.typo3.org] Im Auftrag von François Suter
Gesendet: Mittwoch, 3. September 2014 14:55
An: typo3-dev at lists.typo3.org
Betreff: Re: [TYPO3-dev] sys_categories: API conflicts with core

Hi André,

> To have a file /Configuration/TCA/table_name.php and also
> /Configuration/TCA/Overrides/table_name.php for just one table? But
> as /Configuration/TCA/table_name.php just returns the array, it is
> not possible to add the call to the catagory-api in THIS file. Ist
> hat right?

For a custom table of your own, you should not need an override file. 
You can put everything in /Configuration/TCA/table_name.php. The latter 
is expected to return an array, but you can execute other PHP code 
before returning, for example calling 
ExtensionManagementUtility::makeCategorizable(). However I haven't 
tested this scenario, so I'm not sure if it works fine.

Recently I stumbled on an issue when calling 
ExtensionManagementUtility::makeCategorizable() from a 
/Configuration/TCA/Overrides file, in that the categories field is 
there, but the Category Registry is not filled properly (it is probably 
not initialized properly when the TCA is loaded from cache). As I'm not 
exactly sure how this all works, I haven't dug into that yet. As a work 
around I placed my call ExtensionManagementUtility::makeCategorizable() 
in the extension's ext_tables.php file, which I recommend for now.

Cheers

-- 

Francois Suter

Work: Cobweb Development Sarl - http://www.cobweb.ch

TYPO3: Help the project! - http://typo3.org/contribute/

Appreciate my work? Support me -
http://www.monpetitcoin.com/en/francois/support-me/

_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list