Skip to content

Commit fdc2975

Browse files
[BUGFIX] Fix for $documentArray being null after function getDocumentById is called (#1345)
Co-authored-by: Sebastian Meyer <[email protected]>
1 parent ffc9866 commit fdc2975

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Classes/Controller/AbstractController.php

+3
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,14 @@ protected function buildSimplePagination(PaginationInterface $pagination, Pagina
508508
*/
509509
private function getDocumentByUid(int $documentId)
510510
{
511+
// TODO: implement multiView as it is in getDocumentByUrl
511512
$doc = null;
512513
$this->document = $this->documentRepository->findOneByIdAndSettings($documentId);
513514

514515
if ($this->document) {
515516
$doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true);
517+
// fix for count(): Argument #1 ($value) must be of type Countable|array, null given
518+
$this->documentArray[] = $doc;
516519
} else {
517520
$this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
518521
}

0 commit comments

Comments
 (0)