Uploaded image for project: 'Magnolia Form Module'
  1. Magnolia Form Module
  2. MGNLFORM-359

Mandatory property not working on formFile

XMLWordPrintable

      Steps to reproduce

      1. Configure the formFile component to have a mandatory boolean property. Like formEdit.
      2. Add the formFile component to any formulary with the new property set to true
      3. Trying to submit the form, either with a file attached or not, will result on an error taking place.

      Expected results

      The form can't be submitted only if the file is not attached.

      Actual results

      The form can't be submitted wether the file is attached or not.

      Workaround

      Development notes

      The check seems to take place here:

      https://git.magnolia-cms.com/projects/MODULES/repos/form/browse/magnolia-form/src/main/java/info/magnolia/module/form/templates/components/DefaultFormDataBinder.java#152

      The validation doesn't take into account that StringUtils.isEmpty will return null if the field is an attachment, resulting on it always returning an error.

        Acceptance criteria

              yen.lactue Yen Lac Tue
              rgaona Roberto Gaona
              AuthorX
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 4.25d
                    4.25d