From 8e4145cd3ed78284359736745cd76e7e50cfeba4 Mon Sep 17 00:00:00 2001 From: Adrien Jacob Date: Sat, 2 Dec 2017 13:58:57 +0100 Subject: [PATCH] [BUGFIX] Infinite redirect if cookies are disabled This solves a bug when the browser (eg Safari on mobile) disables all cookies, that produces an infinite redirect on display record plugins --- Classes/Controller/SelectController.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Classes/Controller/SelectController.php b/Classes/Controller/SelectController.php index 64d51ae..b3da097 100644 --- a/Classes/Controller/SelectController.php +++ b/Classes/Controller/SelectController.php @@ -54,15 +54,16 @@ public function indexAction() { $selectedRecordIds = $this->selectSettingsService->getPreselectedRecords(); - if(empty($selectedRecordIds)) + if(empty($selectedRecordIds)) { $selectedRecordIds = [0=>0]; - - $this->selectSessionService->setSelectedRecords($selectedRecordIds); - - // We redirect to the current page in order to reload the selection and records - // with the current values (this is mainly for the possibility, that the - // display-records plugin is above the selection plugin - $this->_redirectToPid(); + $this->selectSessionService->setSelectedRecords($selectedRecordIds); + } else { + $this->selectSessionService->setSelectedRecords($selectedRecordIds); + // We redirect to the current page in order to reload the selection and records + // with the current values (this is mainly for the possibility, that the + // display-records plugin is above the selection plugin + $this->_redirectToPid(); + } } foreach($selectedRecords as $_record)