Permalink
Browse files

FIX JSONDataFormatter wrong relation identifiers (fixes #1795)

  • Loading branch information...
1 parent c8d9886 commit b211f22bf91715b20fb20c697431a8b5ea77d19d @chillu chillu committed Apr 26, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 api/JSONDataFormatter.php
View
4 api/JSONDataFormatter.php
@@ -96,7 +96,7 @@ public function convertDataObjectToJSONObject(DataObjectInterface $obj, $fields
$innerParts[] = ArrayData::array_to_object(array(
"className" => $relClass,
"href" => "$href.json",
- "id" => $obj->$fieldName
+ "id" => $item->$fieldName
));
}
$serobj->$relName = $innerParts;
@@ -117,7 +117,7 @@ public function convertDataObjectToJSONObject(DataObjectInterface $obj, $fields
$innerParts[] = ArrayData::array_to_object(array(
"className" => $relClass,
"href" => "$href.json",
- "id" => $obj->$fieldName
+ "id" => $item->$fieldName
));
}
$serobj->$relName = $innerParts;

1 comment on commit b211f22

@jkempff

Shouldnt it be "id" => $obj->ID?
$fieldName is always the last field name, coming from the foreach loop on line 55.

Please sign in to comment.