Bug #51998

ExtDirect StateProvider only stores first setting in a row

Added by Joh. Feustel over 6 years ago. Updated over 1 year ago.

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

100%

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);
+               }

Associated revisions

Revision d3967c7a (diff)
Added by Joh. Feustel over 6 years ago

[BUGFIX] ExtDirect StateProvider should store all settings

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

Revision ba82faca (diff)
Added by Joh. Feustel over 6 years ago

[BUGFIX] ExtDirect StateProvider should store all settings

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

Revision 6c6582ab (diff)
Added by Joh. Feustel over 6 years ago

[BUGFIX] ExtDirect StateProvider should store all settings

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/25499
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters

History

#1 Updated by Joh. Feustel over 6 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.

#2 Updated by Gerrit Code Review over 6 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

#3 Updated by Gerrit Code Review over 6 years ago

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

#4 Updated by Gerrit Code Review over 6 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

#5 Updated by Gerrit Code Review over 6 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

#6 Updated by Gerrit Code Review over 6 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

#7 Updated by Joh. Feustel over 6 years ago

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

#8 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF