Bug #37195
closedCustom User Settings on be_uesers only work if type=>'text'
30%
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.
Files
Updated by Christoph Buchli over 12 years ago
- % Done changed from 70 to 30
Not sure if the Fix works in all cases... have to recheck it...
Updated by Steffen Gebert over 12 years ago
Thanks for your patch, Christoph! Would you please push it into the review workflow, once you're confident that it's correct? See http://wiki.typo3.org/Contribution_Walkthrough_Tutorials
Steffen
Updated by Wouter Wolters almost 10 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?
Updated by Alexander Opitz over 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.