#37195Custom User Settings on be_uesers only work if type=>'text'
Description
Suppose you want to have a Checkbox in User-Settings where the User can configure something. This Setting, you want to simply be stored in a custom field on the be_user table.
your ext_tables.php might look something like this:
if(t3lib_extMgm::isLoaded('setup') && is_array($GLOBALS['TYPO3_USER_SETTINGS'])) {
$GLOBALS['TYPO3_USER_SETTINGS']['columns'] = array_merge(
$GLOBALS['TYPO3_USER_SETTINGS']['columns'],
array(
'tx_myExtension_allowSomething' => array (
'type' => 'check',
'label' => 'LLL:EXT:myExtension/locallang_db.xml:be_users.tx_myExtension_allowSomething',
'table' => 'be_users',
),
)
);
(Same problem goes with “select”-Fields.)
The Field is displayed properly but you can’t set anything there, since TYPO3 won’t store it to the DB.
The Problem is that while rendering the form the “table”-Setting is ignored.
Means: If you set the field to “text”, the field is rendered the following:
<input id="field_tx_myExtension_someText" type="text" name="data*[be_users]*[tx_myExtension_someText]" value="text" style="width:192px;">
This works perfectly.
But if it’s “check” or “select” it’s:
<input id="field_tx_myExtension_allowSomething" type="checkbox" name="data[tx_myExtension_allowSomething]" class="check">
*Solution*
The attached .diff adds the configured table-name to the name of the input-field while rendering.
Like this, TYPO3 is able to store the value in the be_users table.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.