Issue Bug Closed

#51998ExtDirect StateProvider only stores first setting in a row

Joh. Feustel 09/14/13, 01:11 updated 10/02/18, 12:10

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

  1. Joh. Feustel commented 09/16/13, 02:06

    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. Gerrit Code Review changed status New Under 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

  3. 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

  4. Gerrit Code Review pushed patch set 3 for master to change 23843 11/15/13, 14:16

  5. Gerrit Code Review pushed patch set 1 for TYPO3_6-1 to change 25498 11/19/13, 00:36

  6. Gerrit Code Review pushed patch set 1 for TYPO3_6-0 to change 25499 11/19/13, 00:36

  7. Joh. Feustel commented and changed status Under Review Resolved done 0 % 100 % 11/19/13, 01:30

    Applied in changeset commit:6c6582ab95d9eed208f75ff98de3ecb0a0c321e7.

  8. Benni Mack changed status Resolved Closed 10/02/18, 12:10