From 57a33f273e261d90a31059232b03b14ae4c2f12b Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Tue, 12 Mar 2024 22:09:25 +0000 Subject: [PATCH] chore: Improve NodesSources.php `getOneDisplayableDocument` --- composer.json | 2 +- src/Entity/NodesSources.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index de6e2013..ec15343b 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^2.8.1", "doctrine/doctrine-migrations-bundle": "^3.1", - "doctrine/orm": "~2.17.0", + "doctrine/orm": "~2.19.0", "gedmo/doctrine-extensions": "^3.10.0", "inlinestyle/inlinestyle": "~1.2.7", "james-heinrich/getid3": "^1.9", diff --git a/src/Entity/NodesSources.php b/src/Entity/NodesSources.php index 29bccd26..a7a936a4 100644 --- a/src/Entity/NodesSources.php +++ b/src/Entity/NodesSources.php @@ -297,7 +297,8 @@ public function getOneDisplayableDocument(): ?DocumentInterface { return $this->getDocumentsByFields()->filter(function (NodesSourcesDocuments $nsd) { return null !== $nsd->getDocument() && - $nsd->getDocument()->isImage() && + !$nsd->getDocument()->isPrivate() && + ($nsd->getDocument()->isImage() || $nsd->getDocument()->isSvg()) && $nsd->getDocument()->isProcessable(); })->map(function (NodesSourcesDocuments $nsd) { return $nsd->getDocument();