Skip to content

Commit

Permalink
[BUGFIX] Fix for $documentArray being null after function `getDoc…
Browse files Browse the repository at this point in the history
…umentById` is called (#1345)

Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer authored Oct 8, 2024
1 parent 5c8e795 commit c014e8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,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');
}
Expand Down

0 comments on commit c014e8f

Please sign in to comment.