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 #1

Updated by Joh. Feustel about 11 years ago

See e.g. https://review.typo3.org/#/c/23771/4/typo3/sysext/viewpage/Resources/Public/JavaScript/common.js line 95
To reproduce remove setTimeout() wrapping and check if both settings are stored in $GLOBALS['BE_USER']->uc['moduleData']['web_view']['States'] after a resize in the View module.

Actions #2

Updated by Gerrit Code Review about 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23843

Actions #3

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23843

Actions #4

Updated by Gerrit Code Review about 11 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23843

Actions #5

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25498

Actions #6

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25499

Actions #7

Updated by Joh. Feustel about 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF