Skip to content

Commit 92d5735

Browse files
authored
Merge pull request #52 from Flowpack/bugfix/nameCreateFromNodeSubtreeCommandCorrectly
BUGFIX: Name command method correctly
2 parents 9042e5a + 05a4f70 commit 92d5735

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Classes/Command/NodeTemplateCommandController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NodeTemplateCommandController extends CommandController
3131
* @param string $workspaceName
3232
* @return void
3333
*/
34-
public function createFromNodeSubtree(string $startingNodeId, string $workspaceName = 'live'): void
34+
public function createFromNodeSubtreeCommand(string $startingNodeId, string $workspaceName = 'live'): void
3535
{
3636
$subgraph = $this->contentContextFactory->create([
3737
'workspaceName' => $workspaceName

Classes/NodeTemplateDumper/NodeTemplateDumper.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@ public function createNodeTemplateYamlDumpFromSubtree(NodeInterface $startingNod
4242

4343
$template = $this->nodeTemplateFromNodes([$startingNode], $comments);
4444

45+
$firstEntry = null;
4546
foreach ($template as $firstEntry) {
4647
break;
4748
}
48-
assert(isset($firstEntry));
49+
50+
$properties = $firstEntry['properties'] ?? null;
51+
$childNodes = $firstEntry['childNodes'] ?? null;
52+
4953

5054
$templateInNodeTypeOptions = [
5155
$nodeType->getName() => [
5256
'options' => [
5357
'template' => array_filter([
54-
'properties' => $firstEntry['properties'] ?? null,
55-
'childNodes' => $firstEntry['childNodes'] ?? null,
58+
'properties' => $properties,
59+
'childNodes' => $childNodes
5660
])
5761
]
5862
]

0 commit comments

Comments
 (0)