[BUGFIX] ExtDirect StateProvider should store all settings 43/23843/4
authorJohannes Feustel <s@feustel.eu>
Mon, 16 Sep 2013 00:14:11 +0000 (02:14 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 18 Nov 2013 23:36:06 +0000 (00:36 +0100)
ExtDirect StateProvider seems to queue Ext.state.Manager.set() calls and
collects them to fire only one AJAX call.

In TYPO3\CMS\Backend\InterfaceState\ExtDirect on the other hand setState()
only stores the first item of the data array to $GLOBALS['BE_USER']->uc
the other settings are just ignored. Instead it should iterate the data
array and store all items.

Change-Id: I8d8bd01131545a6cad1a3933184c25c6d5f26149
Fixes: #51998
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/23843
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/backend/Classes/InterfaceState/ExtDirect/DataProvider.php

index b0f9f3a..e3206f6 100644 (file)
@@ -72,7 +72,9 @@ class DataProvider {
        public function setState($parameter) {
                $key = $parameter->params->key;
                $data = json_decode($parameter->params->data);
-               $this->userSettings->set($key . '.' . $data[0]->name, $data[0]->value);
+               foreach ($data as $setting) {
+                       $this->userSettings->set($key . '.' . $setting->name, $setting->value);
+               }
                return array(
                        'success' => TRUE,
                        'params' => $parameter