Skip to content

Commit

Permalink
Merge tag v2.2.12 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Mar 8, 2024
1 parent 0919a6e commit 269bfbb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 397 deletions.
9 changes: 9 additions & 0 deletions src/Exceptions/PrivateDocumentException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace RZ\Roadiz\Documents\Exceptions;

final class PrivateDocumentException extends \InvalidArgumentException
{
}
366 changes: 0 additions & 366 deletions src/Packages.php

This file was deleted.

7 changes: 6 additions & 1 deletion src/Renderer/AbstractImageRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ protected function parseSrcSetInner(
): string {
$output = [];
foreach ($srcSetArray as $set) {
if (isset($set['format']) && isset($set['rule']) && !empty($document->getRelativePath())) {
if (
isset($set['format']) &&
isset($set['rule']) &&
!$document->isPrivate() &&
!empty($document->getRelativePath())
) {
$this->documentUrlGenerator->setOptions($this->urlOptionsResolver->resolve($set['format']));
$this->documentUrlGenerator->setDocument($document);
$path = $this->documentUrlGenerator->getUrl($absolute);
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer/VideoRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected function getPosterUrl(
$document->hasThumbnails()
) {
$thumbnail = $document->getThumbnails()->first();
if ($thumbnail instanceof DocumentInterface) {
if (false !== $thumbnail) {
$this->documentUrlGenerator->setOptions($options);
$this->documentUrlGenerator->setDocument($thumbnail);
return $this->documentUrlGenerator->getUrl($absolute);
Expand Down
Loading

0 comments on commit 269bfbb

Please sign in to comment.