diff --git a/Classes/Controller/CollectionController.php b/Classes/Controller/CollectionController.php index b1a06559d..bbce009c3 100644 --- a/Classes/Controller/CollectionController.php +++ b/Classes/Controller/CollectionController.php @@ -97,7 +97,7 @@ public function listAction(): ResponseInterface $collections = $this->collectionRepository->findAll(); } - if (iterator_count($collections) == 1 && empty($this->settings['showSingle']) && is_array($collections)) { + if (iterator_count($collections) == 1 && $this->settings['showSingle'] && is_array($collections)) { return $this->redirect('show', null, null, ['collection' => array_pop($collections)]); } diff --git a/Tests/Functional/Controller/CollectionControllerTest.php b/Tests/Functional/Controller/CollectionControllerTest.php index 020812d9c..6a48d70e4 100644 --- a/Tests/Functional/Controller/CollectionControllerTest.php +++ b/Tests/Functional/Controller/CollectionControllerTest.php @@ -41,7 +41,7 @@ public function canListAction() 'storagePid' => self::$storagePid, 'solrcore' => self::$solrCoreId, 'collections' => '1', - 'showSingle' => '1', + 'showSingle' => '0', 'randomize' => '' ]; $templateHtml = '{item.collection.indexName}'; @@ -62,6 +62,7 @@ public function canListActionForwardToShow() 'storagePid' => self::$storagePid, 'solrcore' => self::$solrCoreId, 'collections' => '1', + 'showSingle' => '1', 'randomize' => '' ]; $controller = $this->setUpController(CollectionController::class, $settings);