diff --git a/jsonld.php b/jsonld.php index 99e6b5b..6295f06 100644 --- a/jsonld.php +++ b/jsonld.php @@ -2604,10 +2604,10 @@ function _subframe( $embed = new stdClass(); $embeds->{$iri} = $embed; } - else + // replace the existing embed with a reference + else if($embed->{$parent} !== null) { - // replace the existing embed with a reference and update embed info - $embed->{$parent}->{$entry->key} = $value->{'@subject'}; + $embed->{$parent}->{$embed->key} = $value->{'@subject'}; } // update embed entry