[TYPO3-core] RFC #12113: Setting default values for $BE_USER->uc doesn't work for multi-dimensional arrays

Steffen Gebert steffen at steffen-gebert.de
Fri Oct 9 21:44:17 CEST 2009


Hi,

This is SVN patch request.

Type: Bugfix

Branches: trunk, 4_2

BT reference: http://bugs.typo3.org/view.php?id=12113

Problem:
You can set default values for $BE_USER->uc using
a) $TYPO3_CONF_VARS['BE']['defaultUC']
b) setup.default in UserTS

(merged in t3lib_beUserAuth: $this->uc = array_merge($this->uc_default,  
(array)$TYPO3_CONF_VARS['BE']['defaultUC'],  
(array)$this->getTSConfigProp('setup.default')))

Using TS has one major problem:
Imagine, you want to enable "Extended view" (a.k.a. bigControlPanel  
setting of web_list module) by default. So you set the following:
setup.default.moduleData.web_list.bigControlPanel = 1

In good old TS manner, this results in
array(moduleData. => array(web_list. => array(bigControlPanel => 1)))
instead of
array(moduleData => array(web_list => array(bigControlPanel => 1)))
which would be expected to merge into the other arrays (mind the dots!).

So before merging, the array $this->getTSConfigProp('setup.default') has  
to be cleaned up (remove all trailing dots).

Solution:
Add call to t3lib_div::removeDotsFromTS()

How to reproduce:
* Add setup.default.moduleData.web_list.bigControlPanel = 1 to UserTS.
* Goto "User settings" and hit "Reset Configuration and Clear Temporary  
Data" (alternatively you could create a new user).
* List module doesn't use "Extended view", but it should as we set it as  
default.
* Apply the patch
* Reset again
* Try again -> works

Regards
Steffen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 12113.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20091009/f97e7723/attachment.txt 


More information about the TYPO3-team-core mailing list