[MGNLPN-564] Preview As Visitor unusable if JVM default language is not plain english Created: 30/Jul/21  Updated: 01/Sep/21  Resolved: 03/Aug/21

Status: Closed
Project: Magnolia Personalization
Component/s: None
Affects Version/s: 2.0.9
Fix Version/s: 2.1, 2.0.10

Type: Bug Priority: Critical
Reporter: Roman Kovařík Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: GIF File preview-as-visitor.gif    
Issue Links:
Relates
relates to MGNLPN-557 Implement "root level" cookie, header... Closed
causality
caused by MGNLUI-6724 Forms are always created for all lang... Closed
duplicate
duplicates MGNLPN-565 Preview As Visitor unusable Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:

 Description   

Steps to reproduce

  1.  Open https://demo.magnolia-cms.com/.magnolia/admincentral#app:preview-app:detail;/travel:view:
  2.  Select a trait value

Expected results

Value is selected.

Actual results

Field is reset and empty.

Workaround

On some installations, second selection of the value works. Anyway, to workaround the issue:

  1. set the JVM default locale to plain en (no country specified) -Duser.language=en -Duser.country=
  2. To verify the parameters were passed to JVM correctly, go to about app https://demo.magnolia-cms.com/.magnolia/admincentral#app:about:config
  3. Search for user.language, should be en
  4. Search for user.country, either this property is not there or the value is empty

Development notes

  • p13n preview has the locale hardcoded to en.
  • p13n presenter delegates to deprecated ctor of FormPresenter which uses Locale.getDefault() as default language.
  • In case these two differ (even different country like en_EN), two versions of form are created
  • The en version communicates with the backend, but en_EN is visible


 Comments   
Comment by Christopher Zimmermann [ 30/Jul/21 ]

This issue is probably causing another serious issue which is that one cannot enter text into a textfield rule attribute in the "Preview as Visitor" app.
When you enter a letter, it instantly gets removed.

Comment by Chris Jennings [ 30/Jul/21 ]

I cannot make the second selection work either. Whatever I select is ignored.

Comment by Christopher Zimmermann [ 02/Aug/21 ]

Just a note since I see "Magnolia version 6.3", this fix should be made available on 6.2.x as well.

Comment by Roman Kovařík [ 03/Aug/21 ]

Closing as https://nightly.magnolia-cms.com/.magnolia/admincentral#app:preview-app:detail;/marketing-form-sample:view: works and also confirmed in https://magnolia-cms.slack.com/archives/CC1GVEGFP/p1627654806010200.

Comment by Roman Kovařík [ 03/Aug/21 ]

Release notes: https://docs.magnolia-cms.com/product-docs/6.2/Releases/Release-notes-for-Magnolia-CMS-6.2.11/Magnolia-6.2.11-Known-issues.html

Comment by Christopher Zimmermann [ 01/Sep/21 ]

Workaround when running with CLI:

export JAVA_OPTS="-Duser.language=en -Duser.country="

mgnl start
(you have to run it in the same terminal window i think)

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