Skip to content

Commit

Permalink
TASK: Check against LiveWorkspaceName Instead Of Comparing CS Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Jun 26, 2024
1 parent 9525b6c commit 0db5d44
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Classes/CatchUpHook/DocumentUriPathProjectionHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -68,7 +67,7 @@ public function onAfterCatchUp(): void

private function onBeforeNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void
{
if (!$this->isLiveContentStream($event->contentStreamId)) {
if (!$event->workspaceName->isLive()) {
return;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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 {
Expand Down

0 comments on commit 0db5d44

Please sign in to comment.