Skip to content

Commit 0a01f9f

Browse files
authored
Merge pull request #32 from contentstack/live_preview_entry_issue
Fixed Live Preview | Extra key word entry for the reference field bre…
2 parents fdee388 + 3f404c0 commit 0a01f9f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Support/Utility.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,13 @@ public static function contentstackRequest($stack, $queryObject = '', $type = ''
465465
{
466466
$entry_uid = $queryObject->entryUid;
467467
$content_type_uid = $queryObject->contentType->uid;
468-
$live_response_decode = json_decode($response, true);
469-
468+
$response_decode = json_decode($response, true);
469+
if (Utility::isKeySet($response_decode, 'entry')) {
470+
$live_response_decode = $response_decode['entry'];
471+
}
472+
else{
473+
$live_response_decode = $response_decode;
474+
}
470475
}
471476
// wrapper the server result
472477
$response = Utility::wrapResult($response, $queryObject);

0 commit comments

Comments
 (0)