wcm.io validation does not allow multiple validators to be attached to a single field

Description

We noticed that the selectors for the wcm.io validators are too restrictive, they require an exact match. The issue is that, when using multiple validators (it is actually possible to configure the validation-property as a string array property), the exact attribute matching will not work, causing the validator not to be triggered.

In case of a string array property with multiple entries, the values are concatenated with a space (i.e. wcm.io.pattern my.custom.one).

An easy fix would be to replace the = with ~= as is also done in other (OOTB) AEM validators.

Activity

Show:

Stefan Seifert October 13, 2022 at 9:00 AM

yes - release is done

Henry Kuijpers October 13, 2022 at 8:37 AM

Would it be possible to get a release out with this fix?

Stefan Seifert October 13, 2022 at 8:34 AM

agreed - MR is merged, thanks!

Henry Kuijpers October 12, 2022 at 9:34 PM

We very much agree to that! And indeed, we saw that the OOTB validators also seen to do this. I guess the idea is to choose a validator name that is as unique as possible to cause no such conflicts.

We also saw some other validation selectors, that selected on data attributes or class names.

I’m afraid that, given the current setup and also given that Adobe is doing it themselves as well, this is the best way to support having multiple validators.

Stefan Seifert October 12, 2022 at 4:24 PM

hmm, do not like that solution, as matching with ~= will not work if you have multiple validator names starting with the same string e.g.:
wcmio.email
wcmio.emai.special1
wcmio.emai.special2

and then you are looking for wcmio.email.

but it seems adobe is doing it internally for their validators as well

Fixed

Details

Assignee

Reporter

Components

Priority

Created October 12, 2022 at 2:10 PM
Updated October 13, 2022 at 9:00 AM
Resolved October 13, 2022 at 8:34 AM