mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
fixed wrong ID output for many_many and has_many relations
This commit is contained in:
parent
902c8db859
commit
e49d247fba
@ -97,7 +97,7 @@ class JSONDataFormatter extends DataFormatter {
|
|||||||
$innerParts[] = ArrayData::array_to_object(array(
|
$innerParts[] = ArrayData::array_to_object(array(
|
||||||
"className" => $relClass,
|
"className" => $relClass,
|
||||||
"href" => "$href.json",
|
"href" => "$href.json",
|
||||||
"id" => $item->$fieldName
|
"id" => $item->ID
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$serobj->$relName = $innerParts;
|
$serobj->$relName = $innerParts;
|
||||||
@ -118,7 +118,7 @@ class JSONDataFormatter extends DataFormatter {
|
|||||||
$innerParts[] = ArrayData::array_to_object(array(
|
$innerParts[] = ArrayData::array_to_object(array(
|
||||||
"className" => $relClass,
|
"className" => $relClass,
|
||||||
"href" => "$href.json",
|
"href" => "$href.json",
|
||||||
"id" => $item->$fieldName
|
"id" => $item->ID
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$serobj->$relName = $innerParts;
|
$serobj->$relName = $innerParts;
|
||||||
|
Loading…
Reference in New Issue
Block a user