Skip Navigation

[Resolved] Parametric search multi-select not working

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#574791
multi-select.png

I have a view with post-meta filtering. (and post-relationship filters).
It is a multi select.
Selecting multiple values returns no posts found. (there are posts ...)

The filter

[wpv-filter-start hide="false"]
[wpv-filter-controls]
[wpv-control-post-relationship ancestors="market>date" url_param="wpv-relationship-filter"]
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Marknader[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" default_label="Välj Marknad" ancestor_type="market"]
</div><div class="form-group">
	<label>[wpml-string context="wpv-views"]Dagar[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" default_label="Välj Datum" ancestor_type="date"]
</div>
[/wpv-control-post-relationship]
<div class="form-group">
	<label>[wpml-string context="wpv-views"]Bokning status[/wpml-string]</label>
	[wpv-control-postmeta values=",draft,wait,approve,move,accept,refuse,deny,cancel,invoice,paid" display_values="Alla,Påbörjade,Obehandlade,Godkända,Platsbyte,Tackat ja,Tackat nej,Nekade,Cancel,Fakturerade,Betalda" field="wpcf-booking-status" type="multi-select" source="custom" format="%%COUNT%% | %%NAME%%" url_param="wpv-wpcf-booking-status"]
</div>
<div class="form-group">
	[wpv-filter-search-box output="bootstrap"]
</div>
[/wpv-filter-controls]
[wpv-filter-end]
#574800

I see the issue, and it is a logical issue, even thou, it might not seem like it.

When you search by things with a MultiSelect, it works if the data comes from a similar field.
If it comes from a Single Instance field like a number or single line, it fails.

It is a logical issue because it will try to fetch all the options against one post/field if the data comes from a single field.
This is incorrect, as it shows when it works fine as long the data source is a multiple-select field as well (or similar to it).

I escalated this for further analysis.

Thank you.

#576479

The workaround is:

1. Head to your View
2. Find the Query Filter settings, edit the filter for your Field which you let users search thru with a Multiple Select Field.
3. Edit the Settings so it says:

Select items with field:
YourField is a string in URL_PARAM(wpv-wpcf-your_field)

==> Note we are comparing by IN, not "equal to" with this approach, and that solves the technical issue.

We will work on this as a permanent solution but for now, this is the suggested approach.

Thank you!

#576493