[BUGFIX] Hide translations in categories selector 80/23280/2
authorFrancois Suter <francois@typo3.org>
Fri, 23 Aug 2013 16:09:54 +0000 (18:09 +0200)
committerFrancois Suter <francois@typo3.org>
Tue, 27 Aug 2013 11:19:54 +0000 (13:19 +0200)
The \TYPO3\CMS\Core\Category\CategoryRegistry::addTcaColumn() method
provides an API for adding a system categories selector to a given
table. However the generated TCA misses a condition in
"foreign_table_where" to hide translated categories.

Resolves: #51304
Releases: 6.0, 6.1, 6.2
Change-Id: I2622371a89c8eabeb29e835c7f6673ffc6349186
Reviewed-on: https://review.typo3.org/23280
Reviewed-by: Philipp Gampe
Reviewed-by: Francois Suter
Tested-by: Francois Suter
typo3/sysext/core/Classes/Category/CategoryRegistry.php

index 3b77ba8..c8ef04a 100644 (file)
@@ -264,7 +264,7 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                        $fieldConfiguration = array(
                                'type' => 'select',
                                'foreign_table' => 'sys_category',
-                               'foreign_table_where' => ' ORDER BY sys_category.title ASC',
+                               'foreign_table_where' => ' AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC',
                                'MM' => 'sys_category_record_mm',
                                'MM_opposite_field' => 'items',
                                'MM_match_fields' => array('tablenames' => $tableName),