From 965d08c08ecabde8da0806767bce540fad2dea3b Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Mon, 21 Oct 2024 23:43:33 +0200 Subject: [PATCH] BUGFIX: Skip `null` when publishing nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `getNodeFromContextPath(…)` in the Neos.Ui `NodeService` may return `null`, passing these to `publishNodde(…)` fails. This change adds a check and skips those nodes. --- Classes/Controller/BackendServiceController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 54dfa87b20..0f8e2a9ab3 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -237,6 +237,14 @@ public function publishAction(array $nodeContextPaths, string $targetWorkspaceNa foreach ($nodeContextPaths as $contextPath) { $node = $this->nodeService->getNodeFromContextPath($contextPath, null, null, true); + if ($node === null) { + $error = new Info(); + $error->setMessage(sprintf('Could not find node for context path "%s"', $contextPath)); + + $this->feedbackCollection->add($error); + + continue; + } $this->publishingService->publishNode($node, $targetWorkspace); if ($node->getNodeType()->isAggregate()) {