diff --git a/NEWS.md b/NEWS.md index 4347027f859569484cd87e64ab49386c0457a83d..61e9590625fc114c9e8cd7b710968ab72314102e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -210,3 +210,8 @@ Pages and content elements are now categorizable by default. The "Special Menus" content element type now offers the possibility to display a list of categorized pages or content elements. + +* Category fields are excluded by default + +Category fields are created as exclude field (TCA) by default. +If you're upgrading don't forget to add the permission for users. diff --git a/typo3/sysext/core/Classes/Category/CategoryRegistry.php b/typo3/sysext/core/Classes/Category/CategoryRegistry.php index 2ea70aeebf48896269be206c7b84705c72e5d20f..5dd35b07be248ff3f2352a92b3a2659a252672e0 100644 --- a/typo3/sysext/core/Classes/Category/CategoryRegistry.php +++ b/typo3/sysext/core/Classes/Category/CategoryRegistry.php @@ -348,6 +348,7 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface { ), ); + // Merge changes to TCA configuration if (!empty($options['fieldConfiguration'])) { \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule( $fieldConfiguration, @@ -355,14 +356,21 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface { ); } + // Take specific label into account $label = 'LLL:EXT:lang/locallang_tca.xlf:sys_category.categories'; if (!empty($options['label'])) { $label = $options['label']; } + // Take specific value of exclude flag into account + $exclude = TRUE; + if (isset($options['exclude'])) { + $exclude = (bool)$options['exclude']; + } + $columns = array( $fieldName => array( - 'exclude' => 0, + 'exclude' => $exclude, 'label' => $label, 'config' => $fieldConfiguration, ),