Skip to content

Commit

Permalink
TASK: replace contentStreamId with workspaceName where contentStreamI…
Browse files Browse the repository at this point in the history
…d still was used
  • Loading branch information
crydotsnake committed Jun 3, 2024
1 parent b0efca7 commit e6198c9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function run(): ProcessorResult
if ($liveWorkspace === null) {
return ProcessorResult::error('Failed to find live workspace');
}
$assetFilter = AssetUsageFilter::create()->withContentStream($liveWorkspace->currentContentStreamId)->groupByAsset();
$assetFilter = AssetUsageFilter::create()->withWorkspaceName($liveWorkspace->workspaceName)->groupByAsset();

$numberOfExportedAssets = 0;
$numberOfExportedImageVariants = 0;
Expand Down
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/AssetUsage/AssetUsageStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getUsageReferences(AssetInterface $asset): array
$convertedUsages[] = new AssetUsageReference(
$asset,
ContentRepositoryId::fromString($contentRepositoryId),
$usage->contentStreamId,
$usage->workspaceName,
$usage->originDimensionSpacePoint,
$usage->nodeAggregateId
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public function isAssetUsageStillValid(AssetUsage $usage): bool
}
$dimensionSpacePoint = $usage->originDimensionSpacePoint->toDimensionSpacePoint();

// FIXME: AssetUsage->workspaceName ?
$workspace = $this->contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($usage->contentStreamId);
$workspace = $this->contentRepository->getWorkspaceFinder()->findOneByName($usage->workspaceName);
if (is_null($workspace)) {
return false;
}
Expand Down
16 changes: 1 addition & 15 deletions Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,27 +284,13 @@ public function registerAssetChange(AssetInterface $asset): void
->includeVariantsOfAsset();


$workspaceNamesByContentStreamId = [];
foreach ($this->globalAssetUsageService->findByFilter($filter) as $contentRepositoryId => $usages) {
foreach ($usages as $usage) {
// TODO: Remove when WorkspaceName is part of the AssetUsageProjection
$workspaceName = $workspaceNamesByContentStreamId[$contentRepositoryId][$usage->contentStreamId->value] ?? null;
if ($workspaceName === null) {
$contentRepository = $this->contentRepositoryRegistry->get(ContentRepositoryId::fromString($contentRepositoryId));
$workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($usage->contentStreamId);
if ($workspace === null) {
continue;
}
$workspaceName = $workspace->workspaceName;
$workspaceNamesByContentStreamId[$contentRepositoryId][$usage->contentStreamId->value] = $workspaceName;
}
//

$contentRepository = $this->contentRepositoryRegistry->get(ContentRepositoryId::fromString($contentRepositoryId));
$tagsToFlush = array_merge(
$this->collectTagsForChangeOnNodeAggregate(
$contentRepository,
$workspaceName,
$usage->workspaceName,
$usage->nodeAggregateId
),
$tagsToFlush
Expand Down

0 comments on commit e6198c9

Please sign in to comment.