From 0db5d44157d097f509d8f8dd4a229fefc5c90b4f Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:10:19 +0200 Subject: [PATCH] TASK: Check against LiveWorkspaceName Instead Of Comparing CS Ids --- .../CatchUpHook/DocumentUriPathProjectionHook.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Classes/CatchUpHook/DocumentUriPathProjectionHook.php b/Classes/CatchUpHook/DocumentUriPathProjectionHook.php index 445a8d4..2b6c44b 100644 --- a/Classes/CatchUpHook/DocumentUriPathProjectionHook.php +++ b/Classes/CatchUpHook/DocumentUriPathProjectionHook.php @@ -11,7 +11,6 @@ use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; use Neos\RedirectHandler\NeosAdapter\Service\NodeRedirectService; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder; use Neos\Neos\FrontendRouting\Projection\DocumentNodeInfo; use Neos\Neos\FrontendRouting\Exception\NodeNotFoundException; @@ -68,7 +67,7 @@ public function onAfterCatchUp(): void private function onBeforeNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$event->workspaceName->isLive()) { return; } @@ -103,7 +102,7 @@ function ($descendantOfNode) use ($event, $dimensionSpacePoint) { private function onAfterNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$event->workspaceName->isLive()) { return; } @@ -145,7 +144,7 @@ private function onAfterNodePropertiesWereSet(NodePropertiesWereSet $event): voi */ private function handleNodePropertiesWereSet(NodePropertiesWereSet $event, \Closure $closure): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$event->workspaceName->isLive()) { return; } @@ -192,7 +191,7 @@ private function onAfterNodeAggregateWasMoved(NodeAggregateWasMoved $event): voi */ private function handleNodeWasMoved(NodeAggregateWasMoved $event, \Closure $closure): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$event->workspaceName->isLive()) { return; } @@ -218,11 +217,6 @@ private function getState(): DocumentUriPathFinder return $this->contentRepository->projectionState(DocumentUriPathFinder::class); } - private function isLiveContentStream(ContentStreamId $contentStreamId): bool - { - return $contentStreamId->equals($this->getState()->getLiveContentStreamId()); - } - private function findNodeByIdAndDimensionSpacePointHash(NodeAggregateId $nodeAggregateId, string $dimensionSpacePointHash): ?DocumentNodeInfo { try {