Skip to content

Commit

Permalink
Merge pull request #35 from gheggie/master
Browse files Browse the repository at this point in the history
fix(ExternalContentItem): convert complex (i.e. array/object) remote …
  • Loading branch information
nyeholt committed May 7, 2017
2 parents 18226b0 + 8e1f546 commit 1b2ef02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/model/ExternalContentItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ public function getCMSFields() {
foreach($value as $childName => $childValue) {
if(is_object($childValue)) {
foreach($childValue as $childChildName => $childChildValue) {
$childChildValue = (string) $childChildValue;
$childChildValue = is_object($childChildValue) || is_array($childChildValue) ? json_encode($childChildValue) : (string) $childChildValue;
$field = new ReadonlyField("{$childName}{$childChildName}", "{$childName}: {$childChildName}", $childChildValue);
$fields->addFieldToTab('Root.Main', $field);
}
}
else {
$childValue = (string) $childValue;
$childValue = is_object($childValue) || is_array($childValue) ? json_encode($childValue) : (string) $childValue;
$field = new ReadonlyField("{$childName}{$childValue}", $name . ':' . $childName, $childValue);
$fields->addFieldToTab('Root.Main', $field);
}
Expand Down

0 comments on commit 1b2ef02

Please sign in to comment.