Skip to content

Commit

Permalink
Merge pull request #24 from davidspiola/master
Browse files Browse the repository at this point in the history
BUG: register missing ViewHelper arguments
  • Loading branch information
mficzel authored Aug 10, 2020
2 parents 6dd9928 + a4076df commit 9098d2f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Classes/Controller/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ public function createVocabularyAction(NodeInterface $taxonomyRoot, $title, $des

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

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

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

Expand All @@ -340,7 +342,9 @@ public function deleteVocabularyAction(NodeInterface $vocabulary)
} else {
$path = $vocabulary->getPath();
$vocabulary->remove();
$this->flashMessageContainer->addMessage(new Message(sprintf('Deleted vocabulary %s', $path)));
$this->addFlashMessage(
sprintf('Deleted vocabulary %s', $path)
);
}
$taxonomyRoot = $this->taxonomyService->getRoot($vocabulary->getContext());
$this->redirect('index', null, null, ['root' => $taxonomyRoot]);
Expand Down Expand Up @@ -378,8 +382,8 @@ public function createTaxonomyAction(NodeInterface $parent, $title, $description

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

$this->flashMessageContainer->addMessage(
new Message(sprintf('Created taxonomy %s at path %s', $title, $taxonomy->getPath()))
$this->addFlashMessage(
sprintf('Created taxonomy %s at path %s', $title, $taxonomy->getPath())
);

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

$this->flashMessageContainer->addMessage(new Message(sprintf('Updated taxonomy %s', $taxonomy->getPath())));
$this->addFlashMessage(
sprintf('Updated taxonomy %s', $taxonomy->getPath())
);

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

$taxonomy->remove();

$this->flashMessageContainer->addMessage(new Message(sprintf('Deleted taxonomy %s', $taxonomy->getPath())));
$this->addFlashMessage(
sprintf('Deleted taxonomy %s', $taxonomy->getPath())
);

$this->redirect('vocabulary', null, null, ['vocabulary' => $vocabulary]);
}
}
13 changes: 13 additions & 0 deletions Classes/ViewHelpers/DimensionInformationViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@

class DimensionInformationViewHelper extends AbstractViewHelper
{

/**
* Initialize arguments.
*
* @return void
* @throws Exception
*/
public function initializeArguments()
{
$this->registerArgument('node', NodeInterface::class, 'Node', false);
$this->registerArgument('dimension', 'string', 'Dimension', false, null);
}

/**
* @param NodeInterface $node
* @param string $dimension dimension name
Expand Down

0 comments on commit 9098d2f

Please sign in to comment.