Skip to content

Commit

Permalink
BUGFIX: Skip null when publishing nodes
Browse files Browse the repository at this point in the history
The `getNodeFromContextPath(…)` in the Neos.Ui `NodeService` may return `null`, passing these to `publishNodde(…)` fails.

This change adds a check and skips those nodes.
  • Loading branch information
kdambekalns authored Oct 21, 2024
1 parent 288e29a commit 965d08c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 965d08c

Please sign in to comment.