Skip to content

Commit

Permalink
Merge pull request #52 from Flowpack/bugfix/nameCreateFromNodeSubtree…
Browse files Browse the repository at this point in the history
…CommandCorrectly

BUGFIX: Name command method correctly
  • Loading branch information
mhsdesign authored Jun 5, 2023
2 parents 9042e5a + 05a4f70 commit 92d5735
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/Command/NodeTemplateCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NodeTemplateCommandController extends CommandController
* @param string $workspaceName
* @return void
*/
public function createFromNodeSubtree(string $startingNodeId, string $workspaceName = 'live'): void
public function createFromNodeSubtreeCommand(string $startingNodeId, string $workspaceName = 'live'): void
{
$subgraph = $this->contentContextFactory->create([
'workspaceName' => $workspaceName
Expand Down
10 changes: 7 additions & 3 deletions Classes/NodeTemplateDumper/NodeTemplateDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ public function createNodeTemplateYamlDumpFromSubtree(NodeInterface $startingNod

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

$firstEntry = null;
foreach ($template as $firstEntry) {
break;
}
assert(isset($firstEntry));

$properties = $firstEntry['properties'] ?? null;
$childNodes = $firstEntry['childNodes'] ?? null;


$templateInNodeTypeOptions = [
$nodeType->getName() => [
'options' => [
'template' => array_filter([
'properties' => $firstEntry['properties'] ?? null,
'childNodes' => $firstEntry['childNodes'] ?? null,
'properties' => $properties,
'childNodes' => $childNodes
])
]
]
Expand Down

0 comments on commit 92d5735

Please sign in to comment.