From fdc2975575afac89130e691a26230886da10fb48 Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Tue, 8 Oct 2024 17:28:25 +0200 Subject: [PATCH] [BUGFIX] Fix for `$documentArray` being `null` after function `getDocumentById` is called (#1345) Co-authored-by: Sebastian Meyer --- Classes/Controller/AbstractController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 0414ea22f..11dcc671c 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -508,11 +508,14 @@ protected function buildSimplePagination(PaginationInterface $pagination, Pagina */ private function getDocumentByUid(int $documentId) { + // TODO: implement multiView as it is in getDocumentByUrl $doc = null; $this->document = $this->documentRepository->findOneByIdAndSettings($documentId); if ($this->document) { $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true); + // fix for count(): Argument #1 ($value) must be of type Countable|array, null given + $this->documentArray[] = $doc; } else { $this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading'); }