Skip to content

Commit 9098d2f

Browse files
authored
Merge pull request #24 from davidspiola/master
BUG: register missing ViewHelper arguments
2 parents 6dd9928 + a4076df commit 9098d2f

2 files changed

Lines changed: 30 additions & 8 deletions

File tree

Classes/Controller/ModuleController.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ public function createVocabularyAction(NodeInterface $taxonomyRoot, $title, $des
280280

281281
$vocabulary = $taxonomyRoot->createNodeFromTemplate($nodeTemplate);
282282

283-
$this->flashMessageContainer->addMessage(
284-
new Message(sprintf('Created vocabulary %s at path %s', $title, $vocabulary->getPath()))
283+
$this->addFlashMessage(
284+
sprintf('Created vocabulary %s at path %s', $title, $vocabulary->getPath())
285285
);
286286
$this->redirect('index', null, null, ['root' => $taxonomyRoot]);
287287
}
@@ -322,7 +322,9 @@ public function updateVocabularyAction(NodeInterface $vocabulary, $title, $descr
322322
$vocabulary->setProperty('description', $description);
323323
}
324324

325-
$this->flashMessageContainer->addMessage(new Message(sprintf('Updated vocabulary %s', $title)));
325+
$this->addFlashMessage(
326+
sprintf('Updated vocabulary %s', $title)
327+
);
326328
$this->redirect('index', null, null, ['root' => $taxonomyRoot]);
327329
}
328330

@@ -340,7 +342,9 @@ public function deleteVocabularyAction(NodeInterface $vocabulary)
340342
} else {
341343
$path = $vocabulary->getPath();
342344
$vocabulary->remove();
343-
$this->flashMessageContainer->addMessage(new Message(sprintf('Deleted vocabulary %s', $path)));
345+
$this->addFlashMessage(
346+
sprintf('Deleted vocabulary %s', $path)
347+
);
344348
}
345349
$taxonomyRoot = $this->taxonomyService->getRoot($vocabulary->getContext());
346350
$this->redirect('index', null, null, ['root' => $taxonomyRoot]);
@@ -378,8 +382,8 @@ public function createTaxonomyAction(NodeInterface $parent, $title, $description
378382

379383
$taxonomy = $parent->createNodeFromTemplate($nodeTemplate);
380384

381-
$this->flashMessageContainer->addMessage(
382-
new Message(sprintf('Created taxonomy %s at path %s', $title, $taxonomy->getPath()))
385+
$this->addFlashMessage(
386+
sprintf('Created taxonomy %s at path %s', $title, $taxonomy->getPath())
383387
);
384388

385389
$flowQuery = new FlowQuery([$taxonomy]);
@@ -437,7 +441,9 @@ public function updateTaxonomyAction(NodeInterface $taxonomy, $title, $descripti
437441
$taxonomy->setProperty('description', $description);
438442
}
439443

440-
$this->flashMessageContainer->addMessage(new Message(sprintf('Updated taxonomy %s', $taxonomy->getPath())));
444+
$this->addFlashMessage(
445+
sprintf('Updated taxonomy %s', $taxonomy->getPath())
446+
);
441447

442448
$flowQuery = new FlowQuery([$taxonomy]);
443449
$vocabulary = $flowQuery
@@ -466,7 +472,10 @@ public function deleteTaxonomyAction(NodeInterface $taxonomy)
466472

467473
$taxonomy->remove();
468474

469-
$this->flashMessageContainer->addMessage(new Message(sprintf('Deleted taxonomy %s', $taxonomy->getPath())));
475+
$this->addFlashMessage(
476+
sprintf('Deleted taxonomy %s', $taxonomy->getPath())
477+
);
478+
470479
$this->redirect('vocabulary', null, null, ['vocabulary' => $vocabulary]);
471480
}
472481
}

Classes/ViewHelpers/DimensionInformationViewHelper.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77

88
class DimensionInformationViewHelper extends AbstractViewHelper
99
{
10+
11+
/**
12+
* Initialize arguments.
13+
*
14+
* @return void
15+
* @throws Exception
16+
*/
17+
public function initializeArguments()
18+
{
19+
$this->registerArgument('node', NodeInterface::class, 'Node', false);
20+
$this->registerArgument('dimension', 'string', 'Dimension', false, null);
21+
}
22+
1023
/**
1124
* @param NodeInterface $node
1225
* @param string $dimension dimension name

0 commit comments

Comments
 (0)