Skip to content

Commit e804276

Browse files
committed
Do not truncate text fields on node:property:show
1 parent f63bcb8 commit e804276

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ dev-master
2020
- [node:edit] Multivalue references encoded as arrays when editing
2121
- [node:edit] Fixed undefined variable
2222
- [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
2325

2426
beta1
2527
-----

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/Console/Command/Phpcr/NodeCopyCommand.php

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

4747
$workspace = $session->getWorkspace();
48-
49-
$start = microtime(true);
5048
$workspace->copy($srcAbsPath, $destAbsPath, $srcWorkspace);
51-
$end = microtime(true) - $start;
52-
$output->writeln(number_format($end, 6));
5349
}
5450
}

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/Helper/ResultFormatterHelper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function formatQueryResult(QueryResultInterface $result, OutputInterface
7979
), $row->getValues());
8080

8181
foreach ($values as &$value) {
82-
$value = $this->normalizeValue($value);
82+
$value = $this->textHelper->truncate($value, 255);
8383
}
8484

8585
$table->addRow($values);
@@ -96,7 +96,7 @@ public function formatQueryResult(QueryResultInterface $result, OutputInterface
9696
}
9797
}
9898

99-
public function formatValue(PropertyInterface $property, $showBinary = false)
99+
public function formatValue(PropertyInterface $property, $showBinary = false, $truncate = true)
100100
{
101101
$values = $property->getValue();
102102
if (false === $property->isMultiple()) {
@@ -117,6 +117,7 @@ public function formatValue(PropertyInterface $property, $showBinary = false)
117117
}
118118

119119
$return[] = implode('', $lines);
120+
break;
120121
}
121122

122123
return '(binary data)';
@@ -136,7 +137,7 @@ public function formatValue(PropertyInterface $property, $showBinary = false)
136137
break;
137138
case PropertyType::URI :
138139
case PropertyType::STRING :
139-
$return[] = $this->textHelper->truncate($value);
140+
$return[] = $truncate ? $this->textHelper->truncate($value) : $value;
140141
break;
141142
case PropertyType::NAME :
142143
case PropertyType::LONG :

0 commit comments

Comments
 (0)