Skip to content

Commit 57c799c

Browse files
author
roadiz-ci
committed
Merge branch hotfix/v2.2.12
1 parent bd32b05 commit 57c799c

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
parameters:
3-
roadiz_core.cms_version: '2.2.11'
3+
roadiz_core.cms_version: '2.2.12'
44
roadiz_core.cms_version_prefix: 'main'
55
env(APP_NAMESPACE): "roadiz"
66
env(APP_VERSION): "0.1.0"

src/Entity/Document.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,10 @@ public function hasThumbnails(): bool
681681
*/
682682
public function getThumbnails(): Collection
683683
{
684-
return $this->thumbnails;
684+
// Filter private thumbnails
685+
return $this->thumbnails->filter(function (DocumentInterface $thumbnail) {
686+
return !$thumbnail->isPrivate();
687+
});
685688
}
686689

687690
public function setThumbnails(Collection $thumbnails): static

src/Logger/DoctrineHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646

4747
protected function getThumbnailSourcePath(?DocumentInterface $thumbnail): ?string
4848
{
49-
if (null === $thumbnail) {
49+
if (null === $thumbnail || $thumbnail->isPrivate()) {
5050
return null;
5151
}
5252
return $this->documentUrlGenerator

src/Routing/DocumentUrlGenerator.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,13 @@
1313

1414
final class DocumentUrlGenerator extends AbstractDocumentUrlGenerator
1515
{
16-
private UrlGeneratorInterface $urlGenerator;
17-
18-
/**
19-
* @param FilesystemOperator $documentsStorage
20-
* @param UrlHelper $urlHelper
21-
* @param UrlGeneratorInterface $urlGenerator
22-
* @param CacheItemPoolInterface $optionsCacheAdapter
23-
* @throws InvalidArgumentException
24-
*/
2516
public function __construct(
2617
FilesystemOperator $documentsStorage,
2718
UrlHelper $urlHelper,
28-
UrlGeneratorInterface $urlGenerator,
19+
private readonly UrlGeneratorInterface $urlGenerator,
2920
CacheItemPoolInterface $optionsCacheAdapter
3021
) {
3122
parent::__construct($documentsStorage, $urlHelper, $optionsCacheAdapter);
32-
$this->urlGenerator = $urlGenerator;
3323
}
3424

3525
/**

src/TwigExtension/DocumentUrlExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace RZ\Roadiz\CoreBundle\TwigExtension;
66

77
use RZ\Roadiz\Core\AbstractEntities\PersistableInterface;
8-
use RZ\Roadiz\CoreBundle\Entity\Document;
8+
use RZ\Roadiz\Documents\Models\DocumentInterface;
99
use RZ\Roadiz\Documents\UrlGenerators\DocumentUrlGeneratorInterface;
1010
use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException;
1111
use Twig\Error\RuntimeError;
@@ -64,7 +64,7 @@ public function getUrl(PersistableInterface $mixed = null, array $criteria = [])
6464
}
6565
}
6666

67-
if ($mixed instanceof Document) {
67+
if ($mixed instanceof DocumentInterface) {
6868
try {
6969
$absolute = false;
7070
if (isset($criteria['absolute'])) {

0 commit comments

Comments
 (0)