Details
-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
2.7.8
-
None
-
None
Description
Steps to reproduce
- Create a java module with the provided Validator
- Open Configuration app and move to /modules/form/dialogs/formStep/form/tabs/tabMain/fields/formName
- Select the formName node and import the attached xml
- Go to Resources app and edit /mtk2/templates/pages/basic.yaml
- Include the following component within the main area:
mtk2/templates/pages/basic.yaml
form: id: form:components/form
- Open pages app and create a Basic page
- Within the main area, create a Form component
- Type something within the Form name field
- Check nothing is printed at console (Validator should have printed "Custom unique phone number validation executed")
- Go to Definitions app and check a minor error is displayed within the Problems tab:
Definition: form:formStep
Origin: /modules/form/dialogs/formStep
Details: Element [my.company.filter.UniquePhoneNumberValidatorDefinition@280e405f] of type [my.company.filter.UniquePhoneNumberValidatorDefinition] may not be added to the collection of type [interface info.magnolia.ui.form.validator.definition.FieldValidatorDefinition]
Location: /form/tabs/tabMain/fields/formName/validators/uniquePhone
Type: Source data processing problem
Severity: MINOR
Expected results
The custom field validator works
Actual results
Validator cannot be used within the form module (form component)
Workaround
N/A
Development notes
The very same validator works if defined as a field validator at other components (e.g, at a TextField component)
If we switch the Validator definition to the old UI, we still get an error:
WARN class my.company.filter.UniquePhoneNumberValidatorDefinition$ByteBuddy$LBqhP0eh doesn't have replacement in new ui framework. So it can't be converted and as such is skipped.