Skip to content

Commit 17ddcfa

Browse files
committed
Merge pull request #152 from danrot/versioning
removed wrong check from value converter
2 parents d1cc867 + 4b8024a commit 17ddcfa

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
"phpcr/phpcr": "~2.1.0",
3232
"symfony/console": "2.*,>=2.0.5"
3333
},
34+
"conflict": {
35+
"jackalope/jackalope-jackrabbit": "<1.2.1"
36+
},
3437
"autoload": {
3538
"psr-0": {
3639
"PHPCR\\Util": "src"

src/PHPCR/Util/ValueConverter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ public function convertType($value, $type, $srctype = PropertyType::UNDEFINED)
130130
&& $value instanceof NodeInterface
131131
) {
132132
/** @var $value NodeInterface */
133-
// In Jackrabbit a new node cannot be referenced until it has been persisted
134-
// See: https://issues.apache.org/jira/browse/JCR-1614
135-
if ($value->isNew()) {
136-
throw new ValueFormatException('Node ' . $value->getPath() . ' must be persisted before being referenceable');
137-
}
138133
if (! $value->isNodeType('mix:referenceable')) {
139134
throw new ValueFormatException('Node ' . $value->getPath() . ' is not referenceable');
140135
}

tests/PHPCR/Tests/Util/ValueConverterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public function testConvertNewNode()
387387
{
388388
$nodemock = $this->getMock('PHPCR\Tests\Stubs\MockNode');
389389
$nodemock
390-
->expects($this->once())
390+
->expects($this->never())
391391
->method('isNew')
392392
->will($this->returnValue(true))
393393
;
@@ -400,7 +400,7 @@ public function testConvertNonrefNode()
400400
{
401401
$nodemock = $this->getMock('PHPCR\Tests\Stubs\MockNode');
402402
$nodemock
403-
->expects($this->once())
403+
->expects($this->never())
404404
->method('isNew')
405405
->will($this->returnValue(false))
406406
;

0 commit comments

Comments
 (0)