Skip to content

Commit

Permalink
chore: Improve NodesSources.php getOneDisplayableDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Mar 12, 2024
1 parent cdb147d commit 57a33f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/Entity/NodesSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 57a33f2

Please sign in to comment.