From d8f0fd04aec1e9de19aa9c1bdab4e0251adda809 Mon Sep 17 00:00:00 2001 From: Sven Wappler Date: Mon, 23 Dec 2024 22:11:58 +0100 Subject: [PATCH] fixes --- Classes/Controller/GalleryController.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/GalleryController.php b/Classes/Controller/GalleryController.php index 362aebc..b5b6409 100755 --- a/Classes/Controller/GalleryController.php +++ b/Classes/Controller/GalleryController.php @@ -53,9 +53,8 @@ protected function initializeView($view) */ public function listAction(int $offset = 0): ResponseInterface { - - $collectionUids = (trim($this->settings['fileCollection']) !== '') ? explode(',', $this->settings['fileCollection']) : []; - if (isset($this->settings['inlineFileCollection'])) { + $collectionUids = (trim($this->settings['fileCollection'] ?? '') !== '') ? explode(',', $this->settings['fileCollection']) : []; + if (($this->settings['inlineFileCollection'] ?? '') !== '') { $collectionUids = array_merge($collectionUids, explode(',', $this->settings['inlineFileCollection'])); } $cObj = $this->request->getAttribute('currentContentObject'); @@ -72,11 +71,11 @@ public function listAction(int $offset = 0): ResponseInterface if ($this->request->hasArgument('galleryUID')) { $gallery = [$this->request->getArgument('galleryUID')]; - $mediaItems = $this->fileCollectionService->getFileObjectsFromCollection($gallery, $this->settings['order']); + $mediaItems = $this->fileCollectionService->getFileObjectsFromCollection($gallery, $this->settings['order'] ?? 'asc'); $collection = $this->fileCollectionRepository->findByUid($this->request->getArgument('galleryUID')); $showBackToGallerySelectionLink = true; } else { - $mediaItems = $this->fileCollectionService->getFileObjectsFromCollection($collectionUids, $this->settings['order']); + $mediaItems = $this->fileCollectionService->getFileObjectsFromCollection($collectionUids, $this->settings['order'] ?? 'asc'); } if ($collection === null && count($collectionUids) === 1) {