Issue Bug Closed

#21185Setting default values for $BE_USER->uc doesn't work for multi-dimensional arrays

Steffen Gebert 10/04/09, 15:26 updated 08/06/10, 13:30

Description

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

(issue imported from #M12113)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.