silverstripe-admin
silverstripe-admin copied to clipboard
Front-end validation errors display on some search fields
For some FormField types (noticed specifically with CurrencyField but bound to be with others as well), there's front-end validation errors that occur on-blur in the search filters in gridfield.
The example screenshot below comes from https://github.com/silverstripe/silverstripe-framework/pull/11602#pullrequestreview-2610601037
Steps to reproduce
- Set up a
DataObjectwith aCurrencydb field. - Add that field as a searchable field
- make a model admin for the new class
- Click "Search options", click on the currency field, and then click off it.
- Behold, a message saying the value isn't valid.
Notes
- It's unclear whether we should allow some validation here or not. Perhaps engage the UX team?
- Removing the frontend validation resolves the problem, technically, but reduces the usefulness of these specific form fields if they're explicitly used
- Keeping the frontend validation could be useful for some scenarios but isn't backed up with backend validation at all
- You can still submit the form - the error is purely visual
- None of the default scaffolded search fields should have this problem anymore - but it still happens on explicitly set fields like
CurrencyFieldand probablyEmailField