Project

General

Profile

Task #53045

Updated by Anja Leichsenring over 7 years ago


 Currently the @\TYPO3\CMS\Core\Category\CategoryRegistry::getCategoryFieldsForTable()@ method throws an Exception if the menu_type of the current row is not set to @9@. 

 This is not very nice and not reusable. 

 It would be much better if you could simply configure the table name in the TCA that is calling the method so that it looks like that (TCA property name can be disussed): 

 <pre> 
 'category_field' => array( 
	 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:category_field', 
	 'config' => array( 
		 'type' => 'select', 
		 'size' => 1, 
		 'minitems' => 0, 
		 'maxitems' => 1, 
		 'suppress_icons' => 1, 
		 'itemsProcFunc' => 'TYPO3\\CMS\\Core\\Category\\CategoryRegistry->getCategoryFieldsForTable', 
		 'relatedCategoryTable' => 'pages', 
	 ) 
 ) 
 </pre> 

 Additionally we should think about removing the Exception because it will break the Backend for all Extensions / configurations that enhance the menu_type list with their own types and do not already have added the category fields (@selected_categories@, @category_field@)    to the @subtypes_excludelist@ configuration. 

Back