Skip to content

Commit 3f404c0

Browse files
Fixed Live Preview | Extra key word entry for the reference field breaks the live preview
Live Preview | Extra key word entry for the reference field breaks the live preview. Changed the response format. { title: "some title", "reference": { // the reference data } }
1 parent fdee388 commit 3f404c0

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)