diff --git a/Classes/ContentRepository/Service/NodeService.php b/Classes/ContentRepository/Service/NodeService.php index f9cbd2a4c4..372a33867a 100644 --- a/Classes/ContentRepository/Service/NodeService.php +++ b/Classes/ContentRepository/Service/NodeService.php @@ -11,8 +11,12 @@ * source code. */ +use Doctrine\ORM\EntityManagerInterface; +use Neos\ContentRepository\Domain\Factory\NodeFactory; +use Neos\ContentRepository\Domain\Model\NodeData; use Neos\ContentRepository\Domain\Model\NodeInterface; use Neos\ContentRepository\Domain\Model\Workspace; +use Neos\ContentRepository\Domain\Repository\NodeDataRepository; use Neos\ContentRepository\Domain\Service\Context; use Neos\ContentRepository\Domain\Service\ContextFactoryInterface; use Neos\ContentRepository\Domain\Utility\NodePaths; @@ -47,6 +51,24 @@ class NodeService */ protected $domainRepository; + /** + * @Flow\Inject + * @var NodeDataRepository + */ + protected $nodeDataRepository; + + /** + * @Flow\Inject + * @var EntityManagerInterface + */ + protected $entityManager; + + /** + * @Flow\Inject + * @var NodeFactory + */ + protected $nodeFactory; + /** * @var array */ diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 9d9aff3f04..f69c2342d3 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -533,13 +533,9 @@ public function flowQueryAction(array $chain): string $finisher = array_pop($chain); $nodeContextPaths = array_unique(array_column($createContext['payload'], '$node')); + $nodes = $this->nodeService->getNodesFromContextPaths($nodeContextPaths); - $flowQuery = new FlowQuery(array_map( - function ($contextPath) { - return $this->nodeService->getNodeFromContextPath($contextPath); - }, - $nodeContextPaths - )); + $flowQuery = new FlowQuery($nodes); foreach ($chain as $operation) { $flowQuery = call_user_func_array([$flowQuery, $operation['type']], $operation['payload']);