#51998ExtDirect StateProvider only stores first setting in a row
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);
+ }Reviews 3
History 38
-
Joh. Feustel commented 09/16/13, 02:06
-
Gerrit Code Review changed status
NewUnder Review 09/16/13, 02:14 Patch set 1 for branch *master* has been pushed to the review server. It is available at https://review.typo3.org/23843 -
Gerrit Code Review 09/16/13, 02:18 Patch set 2 for branch *master* has been pushed to the review server. It is available at https://review.typo3.org/23843
-
Gerrit Code Review pushed patch set 3 for master to change 23843 11/15/13, 14:16
-
Gerrit Code Review pushed patch set 1 for TYPO3_6-1 to change 25498 11/19/13, 00:36
-
Gerrit Code Review pushed patch set 1 for TYPO3_6-0 to change 25499 11/19/13, 00:36
-
Joh. Feustel commented and changed status
Under ReviewResolved done0 %100 % 11/19/13, 01:30Applied in changeset commit:6c6582ab95d9eed208f75ff98de3ecb0a0c321e7.
-
Benni Mack changed status
ResolvedClosed 10/02/18, 12:10
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.