[MGNLUI-6236] Validation triggers on non-active/not selected fields when using switchableField Created: 23/Sep/20  Updated: 22/Sep/21  Resolved: 14/Oct/20

Status: Closed
Project: Magnolia UI
Component/s: app framework
Affects Version/s: 6.2.3
Fix Version/s: 6.2.4

Type: Bug Priority: Neutral
Reporter: Tobias Kerschbaum Assignee: Adam Siska
Resolution: Fixed Votes: 1
Labels: cs-bk
Remaining Estimate: Not Specified
Time Spent: 19m
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-3625 SwitchableField should only validate ... Closed
relates to MGNLUI-6263 SwitchableField should only validate ... Closed
causality
duplicate
is duplicated by MGNLUI-6263 SwitchableField should only validate ... Closed
supersession
supersedes MGNLUI-6243 Validation error in fields within swi... Closed
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:
Epic Link: UI framework implementation
Sprint: UI FW 13
Story Points: 3

 Description   

When you use a switchableField in the new UI framework to switch between two sets of fields, the fields in both sets are required, validation fails because it does not recognise that the fields in one of the sets are not visible.

A good example to understand the problem can be found here:
https://git.magnolia-cms.com/projects/INCUBATOR/repos/uri-mapping-app/browse/src/main/resources/uri-mapping-app/includes/apps/uri-mapping-app-details-properties.yaml?at=refs%2Fheads%2FupdateTo6.2.3
Just clone the Project with the updateTo6.2.3 Branch and try to save the form with a default or regex mapping.

It still worked in my module in 6.2.1

Dev notes

Could be related to change in defaulting. Visibility status is probably ignored (not accessible) when validating. Custom logic in SwitchableFormView validate() is already checking only the current representation. 


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