[BUGFIX] Move TCA modification of indexed_search to TCA/Overrides 40/31340/2
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 10 Jun 2014 20:31:58 +0000 (22:31 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 5 Jul 2014 12:49:41 +0000 (14:49 +0200)
TCA manipulation code must no longer reside in ext_tables.php, but
moved to Configuration/TCA/Overrides/<tablename>.php. Leftovers
in ext_tables might disturb loading order of TCA changes and spoil
proper caching.

Change-Id: If5998b9c86bc5f7b106fd3f1c9213842b8ae242d
Resolves: #59468
Related: #59414
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/31340
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/indexed_search/Configuration/TCA/Overrides/tt_content.php [new file with mode: 0644]
typo3/sysext/indexed_search/ext_tables.php

diff --git a/typo3/sysext/indexed_search/Configuration/TCA/Overrides/tt_content.php b/typo3/sysext/indexed_search/Configuration/TCA/Overrides/tt_content.php
new file mode 100644 (file)
index 0000000..8735d51
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
+
+// Register "old" FE plugin and hide layout, select_key and pages fields in BE
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(
+       array('LLL:EXT:indexed_search/locallang.xlf:mod_indexed_search', 'indexed_search'),
+       'list_type',
+       'indexed_search'
+);
+$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['indexed_search'] = 'layout,select_key,pages';
+
+// Registers "new" extbase based FE plugin and hide layout, select_key, pages and recursive fields in BE
+\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
+       'indexed_search',
+       'Pi2',
+       'Indexed Search (experimental)'
+);
+$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['indexedsearch_pi2'] = 'layout,select_key,pages,recursive';
index bdfccd6..d42e36f 100644 (file)
@@ -3,15 +3,6 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array('LLL:EXT:indexed_search/locallang.xlf:mod_indexed_search', $_EXTKEY));
-$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY] = 'layout,select_key,pages';
-
-// Registers the Extbase plugin to be listed in the Backend.
-$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
-\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin($_EXTKEY, 'Pi2', 'Indexed Search (experimental)');
-$pluginSignature = strtolower($extensionName) . '_pi2';
-$TCA['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] = 'layout,select_key,pages,recursive';
-
 if (TYPO3_MODE === 'BE') {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
                'tools',
@@ -33,4 +24,4 @@ if (TYPO3_MODE === 'BE') {
        );
 }
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('index_config');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('index_config', 'EXT:indexed_search/locallang_csh_indexcfg.xlf');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('index_config', 'EXT:indexed_search/locallang_csh_indexcfg.xlf');
\ No newline at end of file