[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
Mon Oct 19 23:05:39 CEST 2009


Am 09.10.2009, 21:44 Uhr, schrieb Steffen Gebert  
<steffen at steffen-gebert.de>:

> 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

REMINDER

would be nice to have this fix in 4.2.10 and beta2

Steffen


More information about the TYPO3-team-core mailing list