Skip to content

Commit 20da502

Browse files
committed
bugfix: Node mixin remove does not accept path
1 parent 19488ed commit 20da502

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
dev-master
5+
----------
6+
7+
### Bug fixes
8+
9+
- [node] Mixin remove command does not accept a path
10+
411
alpha-5
512
-------
613

features/phpcr_node_mixin_remove.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Feature: Remove mixin to the current node
1010

1111
Scenario: Remove a mixin to the current node
1212
Given the current node is "/tests_general_base"
13-
And I execute the "node:mixin:remove mix:versionable --no-ansi" command
13+
And I execute the "node:mixin:remove . mix:versionable --no-ansi" command
1414
And I save the session
1515
Then the command should not fail
1616
And the node at "/tests_general_base" should not have the mixin "mix:versionable"

src/PHPCR/Shell/Console/Command/Phpcr/NodeMixinRemoveCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ protected function configure()
1313
{
1414
$this->setName('node:mixin:remove');
1515
$this->setDescription('Remove the named mixin to the current node');
16+
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
1617
$this->addArgument('mixinName', InputArgument::REQUIRED, 'The name of the mixin node type to be removeed');
1718
$this->setHelp(<<<HERE
1819
Removes the specified mixin node type from this node and removes
@@ -28,7 +29,8 @@ public function execute(InputInterface $input, OutputInterface $output)
2829
{
2930
$session = $this->getHelper('phpcr')->getSession();
3031
$mixinName = $input->getArgument('mixinName');
31-
$currentNode = $session->getCurrentNode();
32+
$path = $input->getArgument('path');
33+
$currentNode = $session->getNodeByPathOrIdentifier($path);
3234
$currentNode->removeMixin($mixinName);
3335
}
3436
}

0 commit comments

Comments
 (0)