Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-6236

Validation triggers on non-active/not selected fields when using switchableField

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 6.2.4
    • 6.2.3
    • app framework

      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. 

        Acceptance criteria

              asiska Adam Siska
              tobias.kerschbaum Tobias Kerschbaum
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 19m
                    19m