Skip to content

Commit a0de60d

Browse files
committed
BUGFIX: Prevent exception in overview when ContentReleaseMetadata is not available
1 parent b0aabd7 commit a0de60d

3 files changed

Lines changed: 7 additions & 34 deletions

File tree

Classes/BackendUi/Dto/ContentReleaseOverviewRow.php

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
class ContentReleaseOverviewRow
1515
{
1616
private ContentReleaseIdentifier $contentReleaseIdentifier;
17-
private ContentReleaseMetadata $metadata;
17+
private ?ContentReleaseMetadata $metadata;
1818
private int $enumeratedDocumentNodesCount;
1919
private int $iterationsCount;
2020
private int $errorCount;
@@ -23,7 +23,7 @@ class ContentReleaseOverviewRow
2323
private bool $isActive;
2424
private float $releaseSize;
2525

26-
public function __construct(ContentReleaseIdentifier $contentReleaseIdentifier, ContentReleaseMetadata $metadata,
26+
public function __construct(ContentReleaseIdentifier $contentReleaseIdentifier, ?ContentReleaseMetadata $metadata,
2727
int $enumeratedDocumentNodesCount, int $iterationsCount, int $errorCount,
2828
float $progress, int $renderedUrlCount, bool $isActive, float $releaseSize)
2929
{
@@ -38,73 +38,46 @@ public function __construct(ContentReleaseIdentifier $contentReleaseIdentifier,
3838
$this->releaseSize = $releaseSize;
3939
}
4040

41-
/**
42-
* @return ContentReleaseMetadata
43-
*/
44-
public function getMetadata(): ContentReleaseMetadata
41+
public function getMetadata(): ?ContentReleaseMetadata
4542
{
4643
return $this->metadata;
4744
}
4845

49-
/**
50-
* @return ContentReleaseIdentifier
51-
*/
5246
public function getContentReleaseIdentifier(): ContentReleaseIdentifier
5347
{
5448
return $this->contentReleaseIdentifier;
5549
}
5650

57-
/**
58-
* @return int
59-
*/
6051
public function getEnumeratedDocumentNodesCount(): int
6152
{
6253
return $this->enumeratedDocumentNodesCount;
6354
}
6455

65-
/**
66-
* @return int
67-
*/
6856
public function getIterationsCount(): int
6957
{
7058
return $this->iterationsCount;
7159
}
7260

73-
/**
74-
* @return int
75-
*/
7661
public function getErrorCount(): int
7762
{
7863
return $this->errorCount;
7964
}
8065

81-
/**
82-
* @return float
83-
*/
8466
public function getProgress(): float
8567
{
8668
return $this->progress;
8769
}
8870

89-
/**
90-
* @return int
91-
*/
9271
public function getRenderedUrlCount(): int
9372
{
9473
return $this->renderedUrlCount;
9574
}
9675

97-
/**
98-
* @return bool
99-
*/
10076
public function isActive(): bool
10177
{
10278
return $this->isActive;
10379
}
10480

105-
/**
106-
* @return float
107-
*/
10881
public function getReleaseSize(): float
10982
{
11083
return $this->releaseSize;

Classes/Core/Domain/Dto/ContentReleaseBatchResult.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Flowpack\DecoupledContentStore\Core\Domain\Dto;
44

55
use Flowpack\DecoupledContentStore\Core\Domain\ValueObject\ContentReleaseIdentifier;
6+
use Flowpack\DecoupledContentStore\PrepareContentRelease\Dto\ContentReleaseMetadata;
67
use Neos\Flow\Annotations as Flow;
78

89
/**
@@ -20,15 +21,14 @@ private function __construct(array $results)
2021
$this->results = $results;
2122
}
2223

23-
2424
public static function createFromArray(array $in): self
2525
{
2626
return new self($in);
2727
}
2828

2929
public function getResultForContentRelease(ContentReleaseIdentifier $contentReleaseIdentifier)
3030
{
31-
return $this->results[$contentReleaseIdentifier->jsonSerialize()];
31+
return $this->results[(string)$contentReleaseIdentifier] ?? null;
3232
}
3333

34-
}
34+
}

Classes/PrepareContentRelease/Infrastructure/RedisContentReleaseService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function fetchMetadataForContentReleases(RedisInstanceIdentifier $redisIn
104104
}
105105
$res = $redisPipeline->exec();
106106
foreach ($batchedReleaseIdentifiers as $i => $releaseIdentifier) {
107-
$result[$releaseIdentifier->jsonSerialize()] = ContentReleaseMetadata::fromJsonString($res[$i], $releaseIdentifier);
107+
$result[(string)$releaseIdentifier] = $res[$i] ? ContentReleaseMetadata::fromJsonString($res[$i], $releaseIdentifier) : null;
108108
}
109109
}
110110
return ContentReleaseBatchResult::createFromArray($result);

0 commit comments

Comments
 (0)