[BUGFIX] Move TCA modification of EXT:openid to TCA/Overrides 10/30910/4
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 20 Jun 2014 09:46:16 +0000 (11:46 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 21 Jun 2014 09:38:07 +0000 (11:38 +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: I7b5240eccde3d49531bb734adf26ee623829dc59
Resolves: #59698
Related: #59414
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/30910
Reviewed-by: Olivier Dobberkau
Reviewed-by: Sebastian Fischer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/openid/Configuration/TCA/Overrides/be_users.php [new file with mode: 0644]
typo3/sysext/openid/Configuration/TCA/Overrides/fe_users.php [new file with mode: 0644]
typo3/sysext/openid/ext_tables.php

diff --git a/typo3/sysext/openid/Configuration/TCA/Overrides/be_users.php b/typo3/sysext/openid/Configuration/TCA/Overrides/be_users.php
new file mode 100644 (file)
index 0000000..273b69f
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+// Prepare new columns for be_users table
+$tempColumns = array(
+       'tx_openid_openid' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:openid/locallang_db.xlf:be_users.tx_openid_openid',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => '30',
+                       // Requirement: unique (BE users are unique in the whole system)
+                       'eval' => 'trim,nospace,unique',
+                       'wizards' => array(
+                               '_PADDING' => 2,
+                               '0' => array(
+                                       'type' => 'popup',
+                                       'title' => 'Add OpenID',
+                                       'module' => array(
+                                               'name' => 'wizard_openid'
+                                       ),
+                                       'icon' => 'EXT:openid/ext_icon.gif',
+                                       'JSopenParams' => ',width=600,height=400,status=0,menubar=0,scrollbars=0',
+                               )
+                       ),
+               )
+       )
+);
+// Add new columns to be_users table
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_openid_openid;;;;1-1-1', '', 'after:username');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('be_users', 'EXT:openid' . '/locallang_csh.xlf');
\ No newline at end of file
diff --git a/typo3/sysext/openid/Configuration/TCA/Overrides/fe_users.php b/typo3/sysext/openid/Configuration/TCA/Overrides/fe_users.php
new file mode 100644 (file)
index 0000000..3fb9eb4
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+// Prepare new columns for fe_users table
+$tempColumns = array(
+       'tx_openid_openid' => array(
+               'exclude' => 0,
+               'label' => 'LLL:EXT:openid/locallang_db.xlf:be_users.tx_openid_openid',
+               'config' => array(
+                       'type' => 'input',
+                       'size' => '30',
+                       // Requirement: unique (BE users are unique in the whole system)
+                       'eval' => 'trim,nospace,uniqueInPid',
+                       'wizards' => array(
+                               '_PADDING' => 2,
+                               '0' => array(
+                                       'type' => 'popup',
+                                       'title' => 'Add OpenID',
+                                       'module' => array(
+                                               'name' => 'wizard_openid'
+                                       ),
+                                       'icon' => 'EXT:openid/ext_icon.gif',
+                                       'JSopenParams' => ',width=600,height=400,status=0,menubar=0,scrollbars=0',
+                               )
+                       ),
+               )
+       )
+);
+// Add new columns to fe_users table
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns);
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField('fe_users', 'username', 'tx_openid_openid');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:openid' . '/locallang_csh.xlf');
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_user_setup', 'EXT:openid/locallang_csh_mod.xlf');
\ No newline at end of file
index fdc17e2..d84049b 100644 (file)
@@ -3,52 +3,6 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
-// Prepare new columns for be_users table
-$tempColumns = array(
-       'tx_openid_openid' => array(
-               'exclude' => 0,
-               'label' => 'LLL:EXT:openid/locallang_db.xlf:be_users.tx_openid_openid',
-               'config' => array(
-                       'type' => 'input',
-                       'size' => '30',
-                       // Requirement: unique (BE users are unique in the whole system)
-                       'eval' => 'trim,nospace,unique',
-                       'wizards' => Array(
-                               '_PADDING' => 2,
-                               '0' => Array(
-                                       'type' => 'popup',
-                                       'title' => 'Add OpenID',
-                                       'module' => array(
-                                               'name' => 'wizard_openid'
-                                       ),
-                                       'icon' => 'EXT:openid/ext_icon.gif',
-                                       'JSopenParams' => ',width=600,height=400,status=0,menubar=0,scrollbars=0',
-                               )
-                       ),
-               )
-       )
-);
-// Add new columns to be_users table
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns);
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_openid_openid;;;;1-1-1', '', 'after:username');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('be_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xlf');
-// Prepare new columns for fe_users table
-$tempColumns['tx_openid_openid']['config']['eval'] = 'trim,nospace,uniqueInPid';
-// Add new columns to fe_users table
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns);
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField('fe_users', 'username', 'tx_openid_openid');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xlf');
-// Add field to setup module
-$GLOBALS['TYPO3_USER_SETTINGS']['columns']['tx_openid_openid'] = array(
-       'type' => 'user',
-       'table' => 'be_users',
-       'label' => 'LLL:EXT:openid/locallang_db.xlf:_MOD_user_setup.tx_openid_openid',
-       'csh' => 'tx_openid_openid',
-       'userFunc' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup->renderOpenID',
-       'access' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup'
-);
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToUserSettings('tx_openid_openid', 'after:password2');
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('_MOD_user_setup', 'EXT:openid/locallang_csh_mod.xlf');
 
 if (TYPO3_MODE === 'BE') {
        // Register wizard
@@ -56,4 +10,15 @@ if (TYPO3_MODE === 'BE') {
                'wizard_openid',
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'wizard/'
        );
+
+       // Add field to setup module
+       $GLOBALS['TYPO3_USER_SETTINGS']['columns']['tx_openid_openid'] = array(
+               'type' => 'user',
+               'table' => 'be_users',
+               'label' => 'LLL:EXT:openid/locallang_db.xlf:_MOD_user_setup.tx_openid_openid',
+               'csh' => 'tx_openid_openid',
+               'userFunc' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup->renderOpenID',
+               'access' => 'TYPO3\\CMS\\Openid\\OpenidModuleSetup'
+       );
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToUserSettings('tx_openid_openid', 'after:password2');
 }