Project

General

Profile

Actions

Bug #51998

closed

ExtDirect StateProvider only stores first setting in a row

Added by Joh. Feustel about 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2013-09-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

ExtDirect StateProvider seems to queue Ext.state.Manager.set() calls and collects them to fire only one ajax call.

In TYPO3\CMS\Backend\InterfaceState\ExtDirec on the other hand setState() only stores the first item of the data array to $GLOBALS['BE_USER']->uc the other settins are just ignored.

Simple solution: iterate the data array and store all items:

--- a/typo3/sysext/backend/Classes/InterfaceState/ExtDirect/DataProvider.php
+++ b/typo3/sysext/backend/Classes/InterfaceState/ExtDirect/DataProvider.php
@@ -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);
+               }
Actions

Also available in: Atom PDF