-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRAFT FEATURE: add 'validationErrorMessage' option #3141
DRAFT FEATURE: add 'validationErrorMessage' option #3141
Conversation
Right, this makes sense to me like this, sorry commented on the closed change. |
@@ -487,6 +487,7 @@ Arguments | |||
********* | |||
|
|||
* ``regularExpression`` (string): The regular expression to use for validation, used as given | |||
* ``validationErrorMessage`` (string): The error message to show for validation, if the regular expression validation fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is auto generated from the code and should be updted automatically, so no need to manually change it it, that might just lead to errors with the generator. :)
@@ -39,7 +40,11 @@ protected function isValid($value) | |||
{ | |||
$result = preg_match($this->options['regularExpression'], $value); | |||
if ($result === 0) { | |||
$this->addError('The given subject did not match the pattern. Got: %1$s', 1221565130, [$value]); | |||
if ($this->options['validationErrorMessage']) { | |||
$this->addError($this->options['validationErrorMessage'], 1692962252); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder (mostly a question to other team members with an opinion about this) do we not want to use the same error code here? After all it's the same error just the message is different.
As stated here: I would vouch for closing this and fixing it in the ui #3134 (comment) |
The 'validationErrorMessage' option for Validators was introduced here: neos/neos-ui#2996.
But is currently unusable, see: neos/neos-ui#3691
In a first DRAFT I added 'validationErrorMessage' as an supported option, for the RegularExpressionValidator.
If this looks good, I would add the option to the other validators (adopted in Neos-UI) as well.
So please give some Feedback : )
resolved: neos/neos-ui#3691
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions