verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
95 stars 73 forks source link

Filtering submissions from the index search field not working #1105

Open JeanLucEsser opened 2 years ago

JeanLucEsser commented 2 years ago

Describe the bug

Main issue

For the form fields that allow it (see below), it looks like filtering submissions form the index search filter (Craft 4) do not apply at all.

Also

All form fields types do not look to be search indexable. Well that's not really true actually, let's take the example of a single line text field, you can search its content via the search field, but it is not available as an option in the search filter modal. The only fields that look like they appear as filter options are dropdowns (well, not the country included in the address field though), radios, entries, file uploads and probably a couple more. Is that intended? Plus, maybe we could have the option of setting fields as search indexable on a per field basis like all fields in Craft.

Plus, none of those fields are available as a way to create a custom source. Maybe that's a tricky one as custom sources have to take all fields from all forms into account.

Steps to reproduce

  1. Create a form with a dropdown
  2. Create a few submissions
  3. Go to the submissions index
  4. Go to the search filter modal, add a filter, choose the dropdown
  5. Apply, submissions are not filtered

Form settings

Craft CMS version

4.2.5.2

Plugin version

2.0.12

Multi-site?

No

Additional context

That's a lot, I can break it into more issues or FR if needed, but would love to hear back from you before doing so.

engram-design commented 2 years ago

All fields are searchable by default. But depending on what sort of field it is, will depend on what values are added to the search indexes.

As for the filtering and custom sources (new in Craft 4) we'll look at what we can do to support that.

JeanLucEsser commented 2 years ago

Ok so if I read you right, you did not implement anything to support custom sources or filtering. Which makes sense for custom sources as no custom fields appear as options.

Some fields appear as options for filtering though (not working), so I thought you did something there which is why I filed this as a bug. Maybe that's Craft 4 doing some black magic by default for some kind of fields.

Anyway, thank you for getting back, and if I may, you can add ordering submissions by custom fields to the list for the 2.1.x milestone (or later). Including subfields if it is possible in any way (see https://discord.com/channels/456442477667418113/575387375610626063/1027202204597235793).

engram-design commented 2 years ago

Ok so if I read you right, you did not implement anything to support custom sources or filtering. Which makes sense for custom sources as no custom fields appear as options.

Correct.

Some fields appear as options for filtering though (not working), so I thought you did something there which is why I filed this as a bug. Maybe that's Craft 4 doing some black magic by default for some kind of fields.

A fair point - but this is likely because some fields like options-based fields (Dropdown, Checkboxes and Radios) inherit from the Craft field classes of the same type, which have this implemented. So you're likely going to see these shown, but they won't work.

But yep, won't be too far away and this'll be implemented properly.