Feature: #108843 - User settings configuration migrated to TCA
See forge#108843 See forge#108832
Description
The backend user profile settings configuration, previously stored in
$GLOBALS, is now available in TCA at
$GLOBALS.
This allows the user settings to benefit from TCA-based tooling and provides a consistent API that extensions already use for other configurations.
A new method
Extension has been
introduced to simplify adding custom fields to the user profile settings.
Impact
Extensions can add custom fields to the backend user profile settings using
the new
add method in Configuration/:
// Configuration/TCA/Overrides/be_users.php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserSetting(
'myCustomSetting',
[
'label' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:myCustomSetting',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
],
],
'after:emailMeAtLogin'
);
Alternatively, extensions can directly modify the TCA:
// Configuration/TCA/Overrides/be_users.php
$GLOBALS['TCA']['be_users']['columns']['user_settings']['columns']['myCustomSetting'] = [
'label' => 'LLL:EXT:my_ext/Resources/Private/Language/locallang.xlf:myCustomSetting',
'config' => [
'type' => 'check',
'renderType' => 'checkboxToggle',
],
];
// Add to showitem
$GLOBALS['TCA']['be_users']['columns']['user_settings']['showitem'] .= ',myCustomSetting';
Structure
The
user_ TCA column has the following structure:
columns-
Array of field configurations, each containing:
label- The field label (LLL reference or string)
config- Standard TCA config array (type, renderType, items, etc.)
table(optional)- Set to
'be_if the field is stored in a be_users table columnusers'
showitem- Comma-separated list of fields to display, supports
--for tabsdiv--;
Available field types
input- Text input fieldnumber- Number input fieldemail- Email input fieldpassword- Password input fieldcheckwithrender- Checkbox/toggleType => 'checkbox Toggle' selectwithrender- Select dropdownType => 'select Single' language- Language selector
Backward compatibility
For backward compatibility, the legacy
$GLOBALS array
is still supported. Third-party additions are automatically migrated to TCA after
all ext_ files have been loaded. However, this approach is
deprecated and extensions should migrate to the new TCA-based API.