-
Notifications
You must be signed in to change notification settings - Fork 67
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
DOC Use FieldValidators for FormFieldValidation #621
base: 6
Are you sure you want to change the base?
DOC Use FieldValidators for FormFieldValidation #621
Conversation
c27e818
to
74624d4
Compare
516d1fb
to
53d015b
Compare
7a78385
to
0d23732
Compare
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.
Just some minor changes
a171679
to
788373a
Compare
should trigger a validation error on the page) and pass this to the `extendValidationResult` method to allow extensions | ||
to hook into the validation logic. In addition, in the event of failed validation, a useful error message must be set | ||
on the given validator. | ||
The `validate()` method returns a [`ValidationResult`](api:SilverStripe\Core\Validation\ValidationResult) object with any errors added to it, and should contain a useful error message. The `validate()` method should follow the example above and utilise the `$this->beforeExtending('updateValidate', ...` method and be followed by `return parent::validate();` in order for code in the parent class to be executed in the correct order. |
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.
The `validate()` method returns a [`ValidationResult`](api:SilverStripe\Core\Validation\ValidationResult) object with any errors added to it, and should contain a useful error message. The `validate()` method should follow the example above and utilise the `$this->beforeExtending('updateValidate', ...` method and be followed by `return parent::validate();` in order for code in the parent class to be executed in the correct order. | |
The `validate()` method returns a [`ValidationResult`](api:SilverStripe\Core\Validation\ValidationResult) object with any errors added to it, and should contain a useful error message. The `validate()` method should follow the example above and utilise the `$this->beforeExtending('updateValidate', ...)` method and be followed by `return parent::validate();` in order for code in the parent class to be executed in the correct order. |
As per #621 (comment)
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.
Updated
788373a
to
e939717
Compare
Issue silverstripe/silverstripe-framework#11422