Skip to content

Commit 5db7ad1

Browse files
committed
BUGFIX: nodeindex:indexnode handles multiple dimensions
1 parent 1fb6f0a commit 5db7ad1

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,29 @@ public function indexNodeCommand(string $identifier, string $workspace = null, s
161161
$node = $context->getNodeByIdentifier($identifier);
162162

163163
if ($node === null) {
164-
$this->outputLine('<error>Error: Node with the given identifier was not found.</error>');
165-
$this->quit(1);
164+
return [$workspace->getName(), '-', json_encode($dimensions), 'not found'];
166165
}
167166

168-
$this->outputLine();
169-
$this->outputLine('Indexing node <b>"%s"</b> (%s)', [$node->getLabel(), $node->getIdentifier(),]);
170-
$this->outputLine(' Workspace: %s', [$workspace->getName()]);
171-
$this->outputLine(' Node type: %s', [$node->getNodeType()->getName()]);
172-
$this->outputLine(' Dimensions: %s', [json_encode($dimensions)]);
173-
174167
$this->nodeIndexer->setDimensions($dimensions);
175168
$this->nodeIndexer->indexNode($node);
169+
170+
return [$workspace->getName(), $node->getNodeType()->getName(), json_encode($dimensions), '<success>indexed</success>'];
176171
};
177172

178173
$indexInWorkspace = function ($identifier, Workspace $workspace) use ($indexNode) {
179174
$combinations = $this->contentDimensionCombinator->getAllAllowedCombinations();
175+
176+
$results = [];
177+
180178
if ($combinations === []) {
181-
$indexNode($identifier, $workspace, []);
179+
$results[] = $indexNode($identifier, $workspace, []);
182180
} else {
183181
foreach ($combinations as $combination) {
184-
$indexNode($identifier, $workspace, $combination);
182+
$results[] = $indexNode($identifier, $workspace, $combination);
185183
}
186184
}
185+
186+
$this->output->outputTable($results, ['Workspace', 'NodeType', 'Dimensions', 'State']);
187187
};
188188

189189
if ($workspace === null) {

0 commit comments

Comments
 (0)