Skip to content
Snippets Groups Projects
Commit 55b54a2f authored by Francois Suter's avatar Francois Suter
Browse files

[BUGFIX] Categories as exclude field

When a table is marked as being categorizable, the
categories field is added with an "exclude" flag
hard-coded to 0. Thus it is not possible to hide
this field for editors.

This patch changes the default value to 1 and makes
overridable.

Resolves: #53454
Documentation: #55718
Releases: 6.2
Change-Id: Iff2431b4294b8d3b9cf3dff291186e1a6a2ebafb
Reviewed-on: https://review.typo3.org/27373
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Francois Suter
Tested-by: Francois Suter
parent 3376a5e6
Branches
Tags
No related merge requests found
...@@ -210,3 +210,8 @@ Pages and content elements are now categorizable by default. ...@@ -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 The "Special Menus" content element type now offers the possibility to display
a list of categorized pages or content elements. 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.
...@@ -348,6 +348,7 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface { ...@@ -348,6 +348,7 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
), ),
); );
// Merge changes to TCA configuration
if (!empty($options['fieldConfiguration'])) { if (!empty($options['fieldConfiguration'])) {
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule( \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
$fieldConfiguration, $fieldConfiguration,
...@@ -355,14 +356,21 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface { ...@@ -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'; $label = 'LLL:EXT:lang/locallang_tca.xlf:sys_category.categories';
if (!empty($options['label'])) { if (!empty($options['label'])) {
$label = $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( $columns = array(
$fieldName => array( $fieldName => array(
'exclude' => 0, 'exclude' => $exclude,
'label' => $label, 'label' => $label,
'config' => $fieldConfiguration, 'config' => $fieldConfiguration,
), ),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment