Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-1958

When custom and default validators are used together the validators show errors without setting a value in the field

    Details

      Description

      When custom and default validators are used together the validators show errors without setting a value in the field.

      Steps
      1. On a clean Liferay 6.2 SP11, deploy the Subscriber's email test.war portlet.
      2. In the provided portlet set any email address that's ending with "@humania.ca"
      3. Click Out the field, the email address provided is valid. -> Ok
      4. In the provided portlet set any email address that's not ending with "@humania.ca"
      5. Click Out the field, the email address provided is not valid. -> Ok
      6. In the provided portlet set the email field with an empty value
      7. Click Out the field, the email address provided is not valid. -> Err

      Expected
      The email validator should not make the field required.
      Actual
      Email validator makes the field required.

      Note
      When two default validators are used together and the same steps are performed, no error is displayed.

      Background:

      With the original change in AUI-533, all custom rules required validation, regardless of the required property being set.

      The reasoning for reverting AUI-533 is:

      Custom Rule: custom_AOL: Value must end in "@aol.com"

      • Form (A)
        • Email field with rules:
          • required
          • email
          • custom_AOL
      • Form (B)
        • Email field with rules:
          • email
          • custom_AOL

      So on Form (B), we want to still validate custom_AOL but we don't want to make it required.

      But, with the original change, it will be "required". Even if we explicitly handle blank values...

      E.g. updated Custom Rule: custom_AOL: Value must end in "@aol.com" or blank "".

      ...it will still try to enforce the email rule as required ever though we don't want it to be.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiago.rocha Thiago Rocha (Inactive)
              Reporter:
              preston.crary Preston Crary
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 8 weeks, 4 days ago

                  Packages

                  Version Package
                  2.0.x
                  master
                  master-deprecated
                  3.0.x
                  2.0.0.64-deprecated
                  3.1.x