diff --git a/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php b/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php index 925c3c71106..4eddd56882c 100644 --- a/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php +++ b/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php @@ -78,7 +78,7 @@ public function onAfterCatchUp(): void private function onBeforeNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } @@ -116,11 +116,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 tryGetNode(\Closure $closure): ?DocumentNodeInfo { try { diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php index b0cd3e8d274..b0ade4bd6e9 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathFinder.php @@ -322,4 +322,9 @@ public function getDescendantsOfNode(DocumentNodeInfo $node): DocumentNodeInfos ] ); } + + public function isLiveContentStream(ContentStreamId $contentStreamId): bool + { + return $contentStreamId->equals($this->getLiveContentStreamId()); + } } diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index af8f4cd0783..2fa828d467b 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -232,7 +232,7 @@ private function whenRootWorkspaceWasCreated(RootWorkspaceWasCreated $event): vo private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } foreach ($event->coveredDimensionSpacePoints as $dimensionSpacePoint) { @@ -248,7 +248,7 @@ private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNo private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDimensionsWereUpdated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } @@ -282,7 +282,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim private function whenNodeAggregateWithNodeWasCreated(NodeAggregateWithNodeWasCreated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } if (!$this->isDocumentNodeType($event->nodeTypeName)) { @@ -373,7 +373,7 @@ private function whenNodeAggregateWithNodeWasCreated(NodeAggregateWithNodeWasCre private function whenNodeAggregateTypeWasChanged(NodeAggregateTypeWasChanged $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } if ($this->isShortcutNodeType($event->newNodeTypeName)) { @@ -395,7 +395,7 @@ private function whenNodeAggregateTypeWasChanged(NodeAggregateTypeWasChanged $ev private function whenNodePeerVariantWasCreated(NodePeerVariantWasCreated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } $this->copyVariants( @@ -408,7 +408,7 @@ private function whenNodePeerVariantWasCreated(NodePeerVariantWasCreated $event) private function whenNodeGeneralizationVariantWasCreated(NodeGeneralizationVariantWasCreated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } $this->copyVariants( @@ -421,7 +421,7 @@ private function whenNodeGeneralizationVariantWasCreated(NodeGeneralizationVaria private function whenNodeSpecializationVariantWasCreated(NodeSpecializationVariantWasCreated $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } $this->copyVariants( @@ -462,7 +462,7 @@ private function copyVariants( private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) { @@ -493,7 +493,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) { @@ -524,7 +524,7 @@ private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): vo private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } foreach ($event->affectedCoveredDimensionSpacePoints as $dimensionSpacePoint) { @@ -554,7 +554,7 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo private function whenNodePropertiesWereSet(NodePropertiesWereSet $event, EventEnvelope $eventEnvelope): void { - if (!$this->isLiveContentStream($event->contentStreamId)) { + if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; } $newPropertyValues = $event->propertyValues->getPlainValues(); @@ -625,7 +625,7 @@ private function whenNodePropertiesWereSet(NodePropertiesWereSet $event, EventEn private function whenNodeAggregateWasMoved(NodeAggregateWasMoved $event): void { - if (!$this->isLiveContentStream($event->getContentStreamId())) { + if (!$this->getState()->isLiveContentStream($event->getContentStreamId())) { return; } @@ -762,11 +762,6 @@ private function isShortcutNodeType(NodeTypeName $nodeTypeName): bool return $nodeType->isOfType('Neos.Neos:Shortcut'); } - private function isLiveContentStream(ContentStreamId $contentStreamId): bool - { - return $contentStreamId->equals($this->getState()->getLiveContentStreamId()); - } - private function tryGetNode(\Closure $closure): ?DocumentNodeInfo { try { @@ -952,7 +947,7 @@ private function connectNodeWithSiblings( private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $event): void { - if ($this->isLiveContentStream($event->contentStreamId)) { + if ($this->getState()->isLiveContentStream($event->contentStreamId)) { $this->updateNodeQuery( 'SET dimensionspacepointhash = :newDimensionSpacePointHash WHERE dimensionspacepointhash = :originalDimensionSpacePointHash', @@ -976,7 +971,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev private function whenDimensionShineThroughWasAdded(DimensionShineThroughWasAdded $event): void { - if ($this->isLiveContentStream($event->contentStreamId)) { + if ($this->getState()->isLiveContentStream($event->contentStreamId)) { try { $this->dbal->executeStatement('INSERT INTO ' . $this->tableNamePrefix . '_uri ( nodeaggregateid,