Skip to content

Commit

Permalink
[BUGFIX] Resource type and identifier pairs must be unique. (#918)
Browse files Browse the repository at this point in the history
In to-many relationships.
  • Loading branch information
Abdul Asiq Khan authored and e0ipso committed May 4, 2016
1 parent 6db0cbd commit 6cfe8c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/formatter/FormatterJsonApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ protected function renormalize(array $output, array &$included, $allowed_fields
$new_includes_parents[] = $field_name;
$included[$field_path][$include_key] = $this->renormalize($field_item, $included, $nested_allowed_fields, $new_includes_parents);
$included[$field_path][$include_key] += $include_links ? array('links' => $include_links) : array();
$rel[] = $element;
$rel[$include_key] = $element;
}
// Only place the relationship info.
$result['relationships'][$field_name] = array(
'data' => $single_item ? reset($rel) : $rel,
'data' => $single_item ? reset($rel) : array_values($rel),
);
if (!empty($relationship_links)) {
$result['relationships'][$field_name]['links'] = $relationship_links;
Expand Down

0 comments on commit 6cfe8c2

Please sign in to comment.