[BUGFIX] ExtDirect StateProvider should store all settings 98/25498/2
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:37:06 +0000 (00:37 +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/25498
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/backend/Classes/InterfaceState/ExtDirect/DataProvider.php

index d74f3f6..add8427 100644 (file)
@@ -70,7 +70,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
@@ -80,4 +82,4 @@ class DataProvider {
 }
 
 
-?>
\ No newline at end of file
+?>