diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php index 8684aed30a3..83c73a3588d 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php @@ -152,6 +152,11 @@ protected function buildFullConfiguration(): array } $this->fullConfiguration = Arrays::arrayMergeRecursiveOverrule($mergedConfiguration, $this->localConfiguration); + // Remove unset properties + $this->fullConfiguration['properties'] = array_filter($this->fullConfiguration['properties'], function ($propertyConfiguration) { + return $propertyConfiguration !== null; + }); + if ( isset($this->fullConfiguration['childNodes']) && is_array($this->fullConfiguration['childNodes']) diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php index 9fa0f00408b..68051eab5fd 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeTypeManager.php @@ -220,20 +220,6 @@ protected function loadNodeType(string $nodeTypeName, array &$completeNodeTypeCo ); } - // Remove unset properties - $properties = []; - if (isset($nodeTypeConfiguration['properties']) && is_array($nodeTypeConfiguration['properties'])) { - $properties = $nodeTypeConfiguration['properties']; - } - - $nodeTypeConfiguration['properties'] = array_filter($properties, function ($propertyConfiguration) { - return $propertyConfiguration !== null; - }); - - if ($nodeTypeConfiguration['properties'] === []) { - unset($nodeTypeConfiguration['properties']); - } - $nodeType = new NodeType( NodeTypeName::fromString($nodeTypeName), $superTypes, diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/NodeTypesCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/NodeTypesCommandController.php index faf64e498b4..a1071abdf3e 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/NodeTypesCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/NodeTypesCommandController.php @@ -40,18 +40,24 @@ public function showCommand(string $nodeTypeName, ?string $path = null, string $ $nodeTypeManager = $this->contentRepositoryRegistry->get($contentRepositoryId)->getNodeTypeManager(); if (!$nodeTypeManager->hasNodeType($nodeTypeName)) { - $this->outputLine('NodeType "%s" was not found!', [$nodeTypeName]); + $this->outputLine('NodeType "%s" was not found!', [$nodeTypeName]); $this->quit(); } $nodeType = $nodeTypeManager->getNodeType($nodeTypeName); + + if ($path && !$nodeType->hasConfiguration($path)) { + $this->outputLine('NodeType "%s" does not have configuration "%s".', [$nodeTypeName, $path]); + $this->quit(); + } + $yaml = Yaml::dump( $path ? $nodeType->getConfiguration($path) : [$nodeTypeName => $nodeType->getFullConfiguration()], 99 ); - $this->outputLine('NodeType Configuration "%s":', [$nodeTypeName . ($path ? ("." . $path) : "")]); + $this->outputLine('NodeType configuration "%s":', [$nodeTypeName . ($path ? ("." . $path) : "")]); $this->outputLine(); $this->outputLine($yaml); $this->outputLine();