Custom Validator for Compounds (v13.1 upgrade)

Hi there,

I’m currently upgrading our project from 13.0 to 13.1 so I walked through the steps and one of them was about the custom validators. This change seems to cause a little problem. The problem I’m facing is that validating compounds became less user friendly. Let me explain my situation with a little example.

We have a document type ContentDocument this document contains multiple fields, one of them is the mainContent consisting out of content blocks. One of those content blocks is the list compound with multiple item compounds.

ContentDocument
---- mainContent 
---------- list
---------------item
---------------item
---------------item

The business requires at least 4 items in each list. Therefore we created a MinimalSizeValidator.
Before the upgrade, this validator was attached to the mainContent property of ContentDocument. Although, since the upgrade this does not work as it did before. So I tried some other ways to make it work. My current ‘best’ solution is placing the validator on the list compound instead and giving it the scope ‘document’. This will show my customized error message on top of the document, although up to 3 times, because it does it for each item and it doesn’t highlight the exact field. When going for ‘field’ scope, it will still do the correct validation, although it wont show my customized message and it’s a big guess for the editor what is wrong.

I hope my issue is clear. Looking forward to suggestions on how to improve the user experience here for the cms editors. I’ve already read the documentation on custom validators (https://documentation.bloomreach.com/library/concepts/plugins/create-a-custom-field-validator.html). But I could not find any further help there.

Greetings,
Jesper

After upgrading to v13.2 it works again, I’m not sure why there is nothing mentioned about the custom validators in the release notes. But apparently something chanced what made it work again.

Thanks for the follow-up Jesper, not sure what the 13.1 issue was.

Note that 13.3 is around the corner and it supports new types of validators for fields, compounds and documents, with feedback messages on those levels.

Jeroen