Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Check against LiveWorkspaceName Instead Of Comparing CS Ids #78

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading