Skip to content

Commit

Permalink
Fixed the way we check if a node can be referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Barsotti committed May 30, 2011
1 parent 6e6cefa commit 66717b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Jackalope/Helper.php
Expand Up @@ -176,8 +176,9 @@ public static function convertType($values, $type)
foreach ($values as $v) {
if ($v instanceof \PHPCR\NodeInterface) {
$id = $v->getIdentifier();
//TODO: we should check the type if node is referencable, not rely on getting no identifier
if (empty($id)) {
// In Jackrabbit a new node cannot be referenced until it has been persisted
// See: https://issues.apache.org/jira/browse/JCR-1614
if ($v->isNew() || ! $v->isNodeType('mix:referenceable')) {
throw new \PHPCR\ValueFormatException('Node ' . $v->getPath() . ' is not referencable');
}
$ret[] = $id;
Expand Down

0 comments on commit 66717b2

Please sign in to comment.