diff --git a/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php b/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php index c898ffd7548b478f4a2e2e9497dc88bac7e16e78..ea5c0616b7bcb18024fa80290885a9740160b228 100644 --- a/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php +++ b/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php @@ -75,16 +75,18 @@ class RecyclerAjaxController // Determine the scripts to execute switch ($this->conf['action']) { case 'getTables': - $this->setDataInSession('depthSelection', $this->conf['depth']); + $this->setDataInSession(['depthSelection' => $this->conf['depth']]); /* @var $model Tables */ $model = GeneralUtility::makeInstance(Tables::class); $content = $model->getTables($this->conf['startUid'], $this->conf['depth']); break; case 'getDeletedRecords': - $this->setDataInSession('tableSelection', $this->conf['table']); - $this->setDataInSession('depthSelection', $this->conf['depth']); - $this->setDataInSession('resultLimit', $this->conf['limit']); + $this->setDataInSession([ + 'tableSelection' => $this->conf['table'], + 'depthSelection' => $this->conf['depth'], + 'resultLimit' => $this->conf['limit'], + ]); /* @var $model DeletedRecords */ $model = GeneralUtility::makeInstance(DeletedRecords::class); @@ -154,14 +156,15 @@ class RecyclerAjaxController /** * Sets data in the session of the current backend user. * - * @param string $identifier The identifier to be used to set the data - * @param string $data The data to be stored in the session + * @param array $data The data to be stored in the session */ - protected function setDataInSession($identifier, $data) + protected function setDataInSession(array $data) { $beUser = $this->getBackendUser(); - $beUser->uc['tx_recycler'][$identifier] = $data; - $beUser->writeUC(); + if (!empty(array_diff_assoc($data, $beUser->uc['tx_recycler']))) { + $beUser->uc['tx_recycler'] = array_merge($beUser->uc['tx_recycler'], $data); + $beUser->writeUC(); + } } /**