silverstripe-admin icon indicating copy to clipboard operation
silverstripe-admin copied to clipboard

Front-end validation errors display on some search fields

Open GuySartorelli opened this issue 1 year ago • 0 comments

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

example

Steps to reproduce

  • Set up a DataObject with a Currency db 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 CurrencyField and probably EmailField

GuySartorelli avatar Feb 12 '25 03:02 GuySartorelli