[PAGES-513] Subapp and dialog locale not in sync Created: 30/Sep/21  Updated: 11/Jan/22  Resolved: 16/Nov/21

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 6.2.12
Fix Version/s: 6.2.13

Type: Bug Priority: Major
Reporter: Sebastian Tauch Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: maintenance, ui-team-support
Remaining Estimate: Not Specified
Time Spent: 1h
Original Estimate: Not Specified
Environment:

Demoauthor, any browser


Issue Links:
causality
caused by PAGES-268 Upon locale switch in dialog, the pag... Closed
is causing PAGES-556 EditComponent dialog crashed when sel... Open
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
Date of First Response:
Sprint: UI Maintenance 1
Story Points: 5

 Description   

The locale state between dialogs and subapps is not kept in sync properly and will lead to inconsistent behavior. This is a problem for authors that frequently switch between languages while editing content.

Steps to reproduce

  1. Edit page in pages app:
    1. Subapp locale switcher should show EN
      https://demoauthor.magnolia-cms.com/.magnolia/admincentral#app:pages-app:detail;/travel/about:edit
  2. Edit Page Properties
    1. Select DE as Language
    2. Close Dialog through Cancel (or save, doesn't matter)
  3. Subapp/Editor page is still showing EN page and locale selection
    1. Select main area
    2. Select Add Component
    3. Select Text and Image
  4. Text and Image Component Dialog opens in DE
    1. If saved, the newly created component will have _de properties, but the pages subapp is still in EN view.

Expected results

  • Dialogs open up in the locale that is selected in the current subapp

Actual results

  • Dialog opens up in the locale last selected in a previous dialog

Development notes

  • The locale switcher in a dialog correctly updates the state (LocaleContext) of a subapp
  • However, the subapp doesn't listen to changes of its own LocaleContext.
  • As a result, the subapp may operate in a different locale than is defined in its own LocaleContext.
  • This has wider implications - e.g. all availability rules that operate on the locale, will receive the wrong locale from the subapp -> wrong actions allowed/disallowed in contrast to what the user is seeing

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