[MGNLPN-237] Preview-as-visitor throws a JSON error on public instance Created: 24/Nov/15  Updated: 02/May/17  Resolved: 22/Jan/17

Status: Closed
Project: Magnolia Personalization
Component/s: Preview App
Affects Version/s: 1.2.8, 1.3.1, 1.4.1
Fix Version/s: 1.2.9, 1.3.2, 1.4.2

Type: Bug Priority: Major
Reporter: Antti Hietala Assignee: Evzen Fochr
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: 0d
Time Spent: 1d
Original Estimate: Not Specified

Attachments: PNG File Preview-as-visitor_throws_a_JSON_error.png     Text File stacktrace.txt    
Issue Links:
dependency
is depended upon by MGNLSTK-1549 Use PageTag instead of deprecated Ini... Closed
duplicate
is duplicated by MGNLPN-297 ClassCastException in IFrameNavigatio... Closed
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Kromeriz 80
Story Points: 5

 Description   

The preview-as-visitor function throws a JSON error on public instances.

To reproduce:

  1. Log into a public instance AdminCentral.
  2. Open the Preview as visitor app. --> JSON error

elemental.json.impl.JreJsonNull cannot be cast to elemental.json.JsonString.
RpcInvocationException: Unable to invoke method call in com.vaadin.ui.JavaScript$JavaScriptCallbackRpc
caused by InvocationTargetException
caused by ClassCastException: elemental.json.impl.JreJsonNull cannot be cast to elemental.json.JsonString

Full stack trace attached: stacktrace.txt.

The error is specific to public instances. It is not thrown on an author instance.

The error was discovered by a client who wanted to verify that their variants were published/exported correctly. So there is a valid use case why previewing as visitor should work on public instances. It is not an author-instance-only task.

The error is not related to travel demo content. I was able to reproduce it without demo modules too.



 Comments   
Comment by Roman Kovařík [ 18/Jan/17 ]

Reopened: the fix prevent the error but unfortunately but the preview doesn't work.
After some investigation, it works when cms:page tag is present (and it's only on the author instance where the page editor tags are present)

Comment by Evzen Fochr [ 19/Jan/17 ]

VERSION 1.2.9 must be included as it is for m5.4 w/o cp.

Generated at Mon Feb 12 06:35:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.