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

Regex field validation has changed for blank or empty values

    XMLWordPrintable

Details

    • Yes
    • Yes
    • UI Maintenance 4
    • 2

    Description

      When migrating from 5.7 to 6.2.3 it has been reported that field validation is being triggered for fields which are empty but not required.

      For example, if I had this configuration is Magnolia 5.7:

      validators: 
         - name: rellink
           class: info.magnolia.ui.form.validator.definition.RegexpValidatorDefinition
           pattern: ^\/.*
      

      In 6.2 I need to update the pattern to:

      validators: 
        - name: rellink
          class: info.magnolia.ui.form.validator.definition.RegexpValidatorDefinition
          pattern: ^(|\/.*)$
      

      Dev note:
      validators precede "required: false" property now, this means that conversion of validators should be updated here: info.magnolia.ui.form.field.definition.migration.AbstractConfiguredFieldDefinitionConverter#convertValidators
      (also emailValidator should be revisited to have possibility to have unrequired email field in M6 ui)

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                thien.quach Quach Hao Thien
                rgange Richard Gange
                Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 7.5h
                      7.5h