diff --git a/Classes/Service/HierarchyService.php b/Classes/Service/HierarchyService.php index a67f9df..84d6ad0 100644 --- a/Classes/Service/HierarchyService.php +++ b/Classes/Service/HierarchyService.php @@ -1,4 +1,6 @@ evaluateHierarchyLevelConfiguration($hierarchyLevelConfiguration); $hierarchyLevelNodeType = $this->nodeTypeManager->getNodeType($hierarchyLevelConfiguration['type']); @@ -112,14 +114,17 @@ protected function buildHierarchyLevel(NodeInterface $parentNode, array $hierarc $hierarchyLevelNodeTemplate = new NodeTemplate(); $hierarchyLevelNodeTemplate->setNodeType($hierarchyLevelNodeType); + if (isset($hierarchyLevelConfiguration['properties']['name'])) { $hierarchyLevelNodeName = (string)$this->eelEvaluationService->evaluateIfValidEelExpression($hierarchyLevelConfiguration['properties']['name'], $context); - $hierarchyLevelNodeTemplate->setName(NodeUtility::renderValidNodeName($hierarchyLevelNodeName)); - unset($hierarchyLevelConfiguration['properties']['name']); - } - if ($hierarchyLevelNodeName === '') { - return $parentNode; + if($hierarchyLevelNodeName !== '') { + $hierarchyLevelNodeTemplate->setName(NodeUtility::renderValidNodeName($hierarchyLevelNodeName)); + } else { + $hierarchyLevelNodeName = null; + } + + unset($hierarchyLevelConfiguration['properties']['name']); } if (isset($hierarchyLevelConfiguration['properties'])) { @@ -223,6 +228,7 @@ protected function publishNodeAndChildContent(NodeInterface $node): void } } + $this->logger->log('Publishing node ' . $node->__toString(), LOG_DEBUG); $this->publishingService->publishNode($node); } }