Skip to content

Commit b599337

Browse files
committed
removed wrong check from value converter
1 parent d1cc867 commit b599337

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

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)