Project

General

Profile

Actions

Bug #37195

closed

Custom User Settings on be_uesers only work if type=>'text'

Added by Christoph Buchli over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2012-05-15
Due date:
% Done:

30%

Estimated time:
10.00 h
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

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

beUsersTable.diff (1.26 KB) beUsersTable.diff Christoph Buchli, 2012-05-15 17:33
Actions #1

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...

Actions #2

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

Actions #3

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)?

Actions #4

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.

Actions

Also available in: Atom PDF