[MGNLUI-6505] Non-selected values are kept in switchable field Created: 11/Jan/21  Updated: 25/Jul/23  Resolved: 25/Jul/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.5
Fix Version/s: 6.3.0, 6.2.37

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Antonín Juran
Resolution: Fixed Votes: 1
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: Zip Archive navigation-app.zip    
Issue Links:
Problem/Incident
causality
duplicate
duplicates MGNLUI-5327 Switchable field won't remove a previ... Closed
duplicates MGNLUI-7030 Switchable field creates empty conten... Closed
is duplicated by MGNLUI-5550 New SwitchableField stores values of ... Closed
is duplicated by MGNLUI-8165 Non-selected values are kept in switc... Closed
relation
is related to MGNLUI-8070 Boolean properties persisted by previ... Open
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-8054 Implementation Sub-task Completed Antonín Juran  
MGNLUI-8055 Code review Sub-task Completed Adam Siska  
MGNLUI-8056 Pre-integration QA Sub-task Completed Adam Siska  
MGNLUI-8057 Final QA Sub-task Completed Adam Siska  
MGNLUI-8175 Docu Sub-task Closed Adrian Brooks  
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
Documentation update required:
Yes
Date of First Response:
Epic Link: jcrChildNodeProvider creates nodes for unselected subforms
Sprint: Nucleus 36, Nucleus 41
Story Points: 2
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1.  Create a switchable field in a custom app detail form containing complex fields (use attached module, navigation-app the creation element form)
  2.  Open the form, select one of the options and save a value
  3. Check in JCR browser the stored value under /baseNavigationLinkSite
  4. Edit the created element by selecting another option, enter a new value and save.
  5. Check in JCR browser the new value

 

Expected results

Previous value should have been overwritten by the new value

Actual results

Both values are kept

Workaround

Select field property actually points to the last stored option which would serve to discard values that haven't been chosen.

Development notes

Despite using currentItemProvider as indicated in docs, values for each option are kept



 Comments   
Comment by Jaromir Sarf [ 03/May/23 ]

Discovery:
Use https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/pull-requests/2393/diff#magnolia-ui-framework/src/main/java/info/magnolia/ui/editor/FormView.java as PoC.

Comment by Roman Kovařík [ 02/Jun/23 ]

Reverted due to issue described in https://magnolia-cms.slack.com/archives/C02JTLP0CPP/p1685709559340899.

(The selected option should be always written as last)

Comment by Roman Kovařík [ 07/Jul/23 ]

Reopened: another breaking use case https://magnolia-cms.slack.com/archives/C02JTLP0CPP/p1688729985820859

Comment by Roman Kovařík [ 18/Jul/23 ]

This was fixed on master, you can backport to 6.2 as requested by support (should be disabled by default unlike on master).

Generated at Mon Feb 12 09:37:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.