Skip to content

Commit 53db941

Browse files
committed
TASK: Forgiving data handling in ui service
Previously if `ContentReleaseBatchResult` contained a wrong value or the fallback null the view would crash.
1 parent f68938e commit 53db941

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Classes/BackendUi/BackendUiDataService.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Flowpack\DecoupledContentStore\NodeRendering\Dto\RenderingStatistics;
1515
use Flowpack\DecoupledContentStore\NodeRendering\Infrastructure\RedisRenderingErrorManager;
1616
use Flowpack\DecoupledContentStore\NodeRendering\Infrastructure\RedisRenderingStatisticsStore;
17+
use Flowpack\DecoupledContentStore\PrepareContentRelease\Dto\ContentReleaseMetadata;
1718
use Flowpack\DecoupledContentStore\PrepareContentRelease\Infrastructure\RedisContentReleaseService;
1819
use Flowpack\DecoupledContentStore\ReleaseSwitch\Infrastructure\RedisReleaseSwitchService;
1920
use Neos\Flow\Annotations as Flow;
@@ -81,12 +82,17 @@ public function loadBackendOverviewData(RedisInstanceIdentifier $redisInstanceId
8182
$lastRendering = RenderingStatistics::fromJsonString($lastRenderingStatisticsEntries->getResultForContentRelease($contentReleaseId));
8283
$firstRendering = RenderingStatistics::fromJsonString($firstRenderingStatisticsEntries->getResultForContentRelease($contentReleaseId));
8384

85+
$metadataForContentRelease = $metadata->getResultForContentRelease($contentReleaseId);
86+
$countForContentRelease = $counts->getResultForContentRelease($contentReleaseId);
87+
$iterationsCountForContentRelease = $iterationsCounts->getResultForContentRelease($contentReleaseId);
88+
$errorCountForContentRelease = $errorCounts->getResultForContentRelease($contentReleaseId);
89+
8490
$result[] = new ContentReleaseOverviewRow(
8591
$contentReleaseId,
86-
$metadata->getResultForContentRelease($contentReleaseId),
87-
$counts->getResultForContentRelease($contentReleaseId),
88-
$iterationsCounts->getResultForContentRelease($contentReleaseId),
89-
$errorCounts->getResultForContentRelease($contentReleaseId),
92+
$metadataForContentRelease instanceof ContentReleaseMetadata ? $metadataForContentRelease : null,
93+
is_int($countForContentRelease) ? $countForContentRelease : 0,
94+
is_int($iterationsCountForContentRelease) ? $iterationsCountForContentRelease : 0,
95+
is_int($errorCountForContentRelease) ? $errorCountForContentRelease : 0,
9096
$lastRendering->getTotalJobs() > 0 ? round($lastRendering->getRenderedJobs()
9197
/ $lastRendering->getTotalJobs() * 100) : 100,
9298
$firstRendering->getRenderedJobs(),

0 commit comments

Comments
 (0)