Skip to content

Commit 9d3aee9

Browse files
committed
Merge pull request #153 from phpcr/various_fixes
Various fixes
2 parents 0f42bea + e804276 commit 9d3aee9

16 files changed

+102
-88
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ dev-master
1616
- [embedded] No exit code returned
1717
- [profile] Profile configuration overwritten by session parameters
1818
- [node:list] Incorrect node count
19+
- [node:list] Single references not showing path
20+
- [node:edit] Multivalue references encoded as arrays when editing
21+
- [node:edit] Fixed undefined variable
22+
- [version] Versioning commands can use relative paths
23+
- [node:property:show] Text fields are truncated
24+
- [profile] Workspace given from CLI does not override profile workspace
1925

2026
beta1
2127
-----

features/all/phpcr_version_history.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Feature: Node Version History
77
Given that I am logged in as "testuser"
88
And the "versionable.xml" fixtures are loaded
99

10-
Scenario: Checkout a a given node
11-
Given I execute the "version:history /tests_version_base/versioned" command
10+
Scenario: Show history for a node
11+
When I execute the "version:history /tests_version_base/versioned" command
1212
Then the command should not fail
1313
And I should see a table containing the following rows:
1414
| Name | Created |
1515

1616
Scenario: History on a non versionable node
17-
Given I execute the "version:history /tests_version_base" command
17+
When I execute the "version:history /tests_version_base" command
1818
Then the command should fail
1919
And I should see the following:
2020
"""

features/all/phpcr_version_remove.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Remove node version
88
And the "versionable.xml" fixtures are loaded
99

1010
Scenario: Checkout a a given node
11-
Given I execute the following commands:
11+
When I execute the following commands:
1212
| cd /tests_version_base/versioned |
1313
| version:checkout /tests_version_base/versioned |
1414
| node:property:set foo baz |
@@ -21,7 +21,7 @@ Feature: Remove node version
2121
And I execute the "version:remove /tests_version_base/versioned 1.0" command
2222
Then the command should not fail
2323
And I execute the "version:history /tests_version_base/versioned" command
24-
Then I should not see the following:
24+
And I should not see the following:
2525
"""
2626
| 1.0 |
2727
"""

features/all/phpcr_version_restore.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: Restore a version
88
And the "versionable.xml" fixtures are loaded
99

1010
Scenario: Restore node version
11-
Given I execute the following commands:
11+
When I execute the following commands:
1212
| cd /tests_version_base/versioned |
1313
| node:property:set foo initalbar |
1414
| session:save |

spec/PHPCR/Shell/Config/ProfileLoaderSpec.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function it_should_load_data_into_a_given_profile(
4545
Filesystem $filesystem
4646
)
4747
{
48+
$profile->get('phpcr', 'workspace')->willReturn('default');
4849
$profile->getName()->willReturn('one');
4950
$profile->set('transport', array(
5051
'name' => 'foobar',

src/PHPCR/Shell/Config/ProfileLoader.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,15 @@ public function loadProfile(Profile $profile)
8080
$profile->set('transport', $data['transport']);
8181
}
8282

83+
$profileWorkspace = $profile->get('phpcr', 'workspace');
8384
if (isset($data['phpcr'])) {
8485
$profile->set('phpcr', $data['phpcr']);
8586
}
87+
88+
// workspace argument overrides profile workspace
89+
if ($profileWorkspace && $profileWorkspace !== 'default') {
90+
$profile->set('phpcr', 'workspace', $profileWorkspace);
91+
}
8692
}
8793

8894
public function saveProfile(Profile $profile, $overwrite = false)

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function execute(InputInterface $input, OutputInterface $output)
4545
$srcWorkspace = $input->getArgument('srcWorkspace');
4646

4747
$workspace = $session->getWorkspace();
48-
4948
$workspace->copy($srcAbsPath, $destAbsPath, $srcWorkspace);
5049
}
5150
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ public function execute(InputInterface $input, OutputInterface $output)
5858

5959
foreach ($properties as $property) {
6060
$output->writeln(sprintf(
61-
'<path>%s/</path><localname>%s</localname>: %s',
62-
$pathHelper->getParentPath($property->getPath()),
61+
'<path>%s%s</path><localname>%s</localname>: %s',
62+
$parentPath = $pathHelper->getParentPath($property->getPath()),
63+
$parentPath != '/' ? '/' : '',
6364
$pathHelper->getNodeName($property->getPath()),
64-
$resultFormatHelper->formatValue($property, true)
65+
$resultFormatHelper->formatValue($property, true, false)
6566
));
6667
}
6768
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function execute(InputInterface $input, OutputInterface $output)
6868
$node = $session->getNodeByPathOrIdentifier($path);
6969
$nodeHelper->assertNodeIsVersionable($node);
7070

71-
$version = $versionManager->checkin($path);
71+
$version = $versionManager->checkin($node->getPath());
7272

7373
$output->writeln('Version: ' . $version->getName());
7474
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ public function execute(InputInterface $input, OutputInterface $output)
5454
$nodeHelper->assertNodeIsVersionable($node);
5555

5656
$versionManager = $workspace->getVersionManager();
57-
$version = $versionManager->checkout($absPath);
57+
$version = $versionManager->checkout($node->getPath());
5858
}
5959
}

0 commit comments

Comments
 (0)