[MGNLUI-6815] No validation errors shown for multiFields Created: 06/Aug/21  Updated: 01/Oct/21  Resolved: 01/Oct/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.11
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Jeffrey van der Heide Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File NodePropertyValidatorDefinition.java     Java Source File NodePropertyValidatorFactory-1.java     PNG File image-2021-08-06-13-09-59-328.png    
Issue Links:
Relates
duplicate
is duplicated by MGNLUI-6842 Validation messages are not displayed... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Steps to reproduce

  1. Create a (page) dialog with a jcrMulti(Value)Field
  2. Add another field as it's child e.g. linkField
  3. Add a validator to the linkField
  4. Enter content that does not match the validator 
  5. No error is shown, but the form won't submit (atleast that's good)

Expected results

We expect to see an error message just like other field that are not directly below a multifield

Actual results

No error is shown

Workaround

n/a

 

Field configuration: 

 products:
      $type: jcrMultiValueField
      required: true
      field:
        $type: linkField
        textInputAllowed: true
        filteringMode: CONTAINS
        showOptions: true
        required: true
        datasource:
          $type: jcrDatasource
          workspace: products
          describeByProperty: displayName
          allowedNodeTypes:
            - client:productCategory
            - client:productLine
            - client:decorSet
            - client:decor
            - client:finish
        validators:
          requiresCategory:
            $type: nodePropertyValidator
            propertyName: jcr:primaryType
            pattern: ^client:finish$
            errorMessage: validators.requiresNodeType.errorMessage
 

 Custom validator used:

The custom validator used is attached, feel free to add it to the product if it satisfies needs. 
But it's not needed to reproduce the issue, (required also fails). 
The reason we're using the custom validator is to make sure the chooser shows the content tree completely to preserve the tree structure, but we only allow the deepest level (finish in this case).

 

 


Generated at Mon Feb 12 09:40:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.