From 4a85f6b882bd68e47e233adcc900b22d24a930ca Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 30 Jun 2024 11:52:59 +0200 Subject: [PATCH] TASK: Fix flowqueries to use new `aggregateId` --- .../Classes/FlowQueryOperations/ClosestOperation.php | 1 + .../Classes/FlowQueryOperations/NextAllOperation.php | 3 ++- .../Classes/FlowQueryOperations/NextOperation.php | 3 ++- .../Classes/FlowQueryOperations/NextUntilOperation.php | 3 ++- .../Classes/FlowQueryOperations/ParentOperation.php | 2 +- .../Classes/FlowQueryOperations/ParentsUntilOperation.php | 3 ++- .../Classes/FlowQueryOperations/PrevAllOperation.php | 3 ++- .../Classes/FlowQueryOperations/PrevOperation.php | 3 ++- .../Classes/FlowQueryOperations/PrevUntilOperation.php | 3 ++- .../Classes/FlowQueryOperations/SiblingsOperation.php | 1 + 10 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ClosestOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ClosestOperation.php index 782249ae878..7643e637141 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ClosestOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ClosestOperation.php @@ -64,6 +64,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) } $output = []; + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { $contextNodeQuery = new FlowQuery([$contextNode]); $contextNodeQuery->pushOperation('first', []); diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php index 89bc14f75f9..72554d68337 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php @@ -68,9 +68,10 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $output = []; $outputNodePaths = []; foreach ($flowQuery->getContext() as $contextNode) { + /** @var Node $contextNode */ $nextNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findSucceedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindSucceedingSiblingNodesFilter::create() ); foreach ($nextNodes as $nextNode) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php index 9903cb806cb..e3db9f03141 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php @@ -69,9 +69,10 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $output = []; $outputNodePaths = []; foreach ($flowQuery->getContext() as $contextNode) { + /** @var Node $contextNode */ $nextNode = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findSucceedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindSucceedingSiblingNodesFilter::create() )->first(); if ($nextNode !== null && !isset($outputNodePaths[$nextNode->aggregateId->value])) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php index e79d0fe7dc2..9ca1494045a 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php @@ -72,9 +72,10 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $outputNodeIdentifiers = []; foreach ($flowQuery->getContext() as $contextNode) { + /** @var Node $contextNode */ $nextNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findSucceedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindSucceedingSiblingNodesFilter::create() ); if (isset($arguments[0]) && !empty($arguments[0])) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php index fb3f84f41d3..07790c7c64d 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php @@ -66,8 +66,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) { $output = []; $outputNodeAggregateIds = []; + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { - /* @var $contextNode Node */ $parentNode = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findParentNode($contextNode->aggregateId); if ($parentNode === null) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php index 864aa5276c4..76beab42acf 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php @@ -78,9 +78,10 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) NodeTypeNames::with(NodeTypeNameFactory::forRoot()) ) ); + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { $parentNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) - ->findAncestorNodes($contextNode->nodeAggregateId, $findAncestorNodesFilter); + ->findAncestorNodes($contextNode->aggregateId, $findAncestorNodesFilter); if (isset($arguments[0]) && !empty($arguments[0] && !$parentNodes->isEmpty())) { $filterQuery = new FlowQuery(iterator_to_array($parentNodes)); $filterQuery->pushOperation('filter', [$arguments[0]]); diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php index f646c63c5cf..cf4599636d4 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php @@ -67,10 +67,11 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) { $output = []; $outputNodeAggregateIds = []; + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { $prevNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findPrecedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindPrecedingSiblingNodesFilter::create() )->reverse(); foreach ($prevNodes as $prevNode) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php index a50f0eacd47..167fff1a12e 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php @@ -67,10 +67,11 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void { $output = []; $outputNodePaths = []; + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { $previousNode = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findPrecedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindPrecedingSiblingNodesFilter::create() )->first(); if ($previousNode !== null && !isset($outputNodePaths[$previousNode->aggregateId->value])) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php index 62faaf35669..bd7b854cfcd 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php @@ -71,10 +71,11 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void $output = []; $outputNodeIdentifiers = []; + /** @var Node $contextNode */ foreach ($flowQuery->getContext() as $contextNode) { $prevNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findPrecedingSiblingNodes( - $contextNode->nodeAggregateId, + $contextNode->aggregateId, FindPrecedingSiblingNodesFilter::create() ); if (isset($arguments[0]) && !empty($arguments[0])) { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php index 13f76207072..8282af2b9f8 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php @@ -72,6 +72,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void } foreach ($flowQuery->getContext() as $contextNode) { + /** @var Node $contextNode */ $subgraph = $this->contentRepositoryRegistry->subgraphForNode($contextNode); $parentNode = $subgraph->findParentNode($contextNode->aggregateId);