[MGNLFORM-252] Validators in the form module should override validateWithResult Created: 08/Dec/14  Updated: 30/Apr/15  Resolved: 25/Feb/15

Status: Closed
Project: Magnolia Form Module
Component/s: validation
Affects Version/s: 1.4.12, 2.2.8
Fix Version/s: 2.2.11

Type: Improvement Priority: Neutral
Reporter: Richard Gange Assignee: Evzen Fochr
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
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)
Release notes required:
Yes
Date of First Response:

 Description   

Form validators such as the new RegexValidator do not override the validateWithResult method but instead the old validate method. And as mentioned in MGNLFORM-79 this causes the old behaviour where only the default error messages defined in the form module resource bundle itself are used. And so people that use say the RegexValidator class are not able to define their own error messages (in their own module's resource bundles). As suggested in MGNLFORM-79, we should deprecate the Validator#validate method in favor of the validateWithResult method.



 Comments   
Comment by Evzen Fochr [ 19/Feb/15 ]

Default Form messages are specified in info.magnolia.module.form.* files under keys form.user.errorMessage.*
Added property errorMessage to Validator class so user can specify new key for error message.

Generated at Mon Feb 12 05:38:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.