You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good if we could cascade Field errors to display like the Page error for consistency and better user experience. (Both errors display differently but we only trigger the Save button. )
I'm not sure what you mean by "page error". We have two validation error messages here:
EmailField form field validation error message - this is a form validation error
RequiredFields validator error message - this is a form validation error
The only difference I can see between the two with a quick glance is that one uses the "required" message type, and the other uses the "validation" message type - but both should definitely display the same way.
I would expect a "page error" to be one that comes from the validate() method on your page. Did you check whether that one indicates the tab or not?
You've raised this against the silverstripe/silverstripe-cms repository - does this mean you have confirmed that these both behave/display the same way when editing records in a GridField (e.g. in a ModelAdmin)?
GuySartorelli
changed the title
Form field validation/error does not cascade to Page validation/error
Form field validation/error doesn't highlight the tab where the error occurred
May 21, 2024
Turns out the gridfield edit form doesn't have the tab highlight functionality, so this is specific to editing SiteTree.
Confirmed that this is only incorrect when using validation from form fields, which for some reason use "validation" as the error type, which isn't technically a valid type (should use one of the consts on ValidationResult), but it's been there forever so we can't just change that in a patch.
I'll make a PR with the minimal change required to fix this.
Module version(s) affected
5.2.1
Description
An EmailField validating the input does not cascade into a Page Error.
As you can see below when the Field is required then it will show a Tab notification icon and a page error on top
More context: https://silverstripe-users.slack.com/archives/CCP2NDQTX/p1716246349181239
AC:
Save
button. )How to reproduce
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)PRs
The text was updated successfully, but these errors were encountered: