Details
-
Improvement
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
-
None
-
Tiger
-
Tiger Sprint 209
Description
Functional description
The new system has two lists of validators: old style (located at /hippo:configuration/hippo:frontend/cms/cms-validators) and new style (located at /hippo:configuration/hippo:modules/validation/hippo:moduleconfig).
The Visual Editor in the Channel Manager only uses the new style validators. The Document Editor in the Content perspective reads and uses both validators.
When the Document Editor finds an old style validator with the same name as a new style validator it should log a warning and still use the new style validator. This prevent the odd situation that both editors use different validator implementations with possibly different behavior.
To prevent warnings for duplicate validators out-of-the-box, the two lists of validators should contain distinct names. There should be no validators with the same name in both lists. For this reason, all out-of-the-box validators that were converted to the new style should be removed from the old style list:
- escaped
- html (new style name: 'non-empty-html')
- non-empty
- image-references
- non-empty
- references
Some notes:
- The old style 'resource-required' validator no longer exists. It has been replaced by the new style validator required/hippo:resource.
- The old combination of "required" and "non-empty" is no longer necessary because the "required/String" validator checks that required string values are not empty.
To handle existing document types seamlessly, some validator names and combinations are re-interpreted at runtime (this has been implemented inĀ CMS-11947)
- "required" + "non-empty" --> "required"
- "resource-required" --> "required"
- "html" --> "non-empty-html"
- "non-empty" on an Html (a.k.a. "formatted text") field --> "non-empty-html"
Changes to do in this issue
- let the Document Editor prefer the new style validators over the old style
- let the Document Editor log a warning when it find an old style validator with the same name as a new style validator
- remove all old-style validators that have been migrated to new style validators
Removing old style validator nodes is fine since they are classified as HCM config. These config changes should be documented in BCCM though.
Attachments
Issue Links
- is a result of
-
CMS-11732 Make script to move validator configuration conditionally
- Closed