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

Total Dialog Validation Error Messages and Total Figure Not Synchronised

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Neutral Neutral
    • None
    • 5.4
    • dialogs
    • None

      This may be timely as I see MGNLUI-2542 has been looked at in June.

      I have attempted to build a system for cross-field validation ensuring that two or more fields contain distinct values. I have found that error messages are shown to the user when there is a value returned from AbstractField.getErrorMessage() but the total errors in the dialog header is calculated by re-running isValid on each item - this happens within info.magnolia.ui.vaadin.form.Form.isValid().

      In my case, this means that a field that was valid when first evaluated but becomes invalid because of a clash will not show an error message but will be counted in the total. This results in a user being told there are X errors but only seeing X-1 messages.

      I believe the process should be tightened to ensure the numbers remain the same. For my particular case, I would prefer to see the error messages counted by examining the response from getErrorMessage() ie. Ignoring the first field to contain a duplicated value because it was valid. However, I understand that the other route may be desirable: call isValid() and only call getErrorMessage() if the response is false.

      Further notes on my project are available at: https://github.com/malleusconsulting/uniqueness-validator-module#issues-and-limitations

        Acceptance criteria

              Unassigned Unassigned
              ChrisJ OLD Chris Jennings (Malleus) (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD