Skip Navigation

[Resolved] Query filter using checkboxes field

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user is trying to filter his view by some checkbox value but it's not filtering correctly.
Solution:

If you're experiencing this issue, please try the fix below.
https://toolset.com/errata/checkboxes-that-save-0-are-interpreted-as-checked-by-views/

This support ticket is created 6 years, 8 months 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 17 replies, has 2 voices.

Last updated by Zach Jones 6 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#623737
Screen Shot 2018-03-09 at 9.21.06 AM.png

For one of our user types, we have created a user field that is a set of checkboxes (State Affiliations). Users are able to select multiple checkboxes.

I’ve created several views that displays users based on the states that they chose in the above field. I’m trying to filter this view based on the checkboxes field. For example, if a user has selected AL, AK, and OH in the checkboxes section, the user should be displayed on each of these pages. I have a separate view set up for each state, and then I placed each of these views on a separate page.

Attached, you will see a screenshot of the query filter I am trying to use. The constant changes for each state I am trying to display.

When I remove the query filter, all users show, so I know something in the query filter is not working correctly.

Could you tell me if I have this configured properly?

#623808

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

Thank you for contacting our support forum.

For clarity is it that you want your users to be able to filter this view on the frontend ?

Please let me know.

Thanks,
Shane

#623820

Hi Shane,

No, users will not have the ability to filter on the front-end. This is just a standard user view placed on standard page. It appears that the query filter is not working correctly. The query filter that I have added in the backend should only return users that match the query filter.

Does this make sense?

#623824

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

Yes it does makes sense.

Essentially you want a prefiltered view.

Would you mind providing me with admin access to the website so that I can have a look at this for you ?

Thanks,
Shane

#623826
#623834

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

There seems to be something interfering with the code as i've checked the views debug information and the query information is being passed but the view isn't updating accordingly.

Would you mind temporarily disable all your non-toolset plugin and try again.

Thanks,
Shane

#623836

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Also it seems the correct query is not being passed to the database.

Is there any caching on the site?

#623839

Hi Shane,

Unfortunately, this site is live so we are unable to disable non-Toolset plugins. I will say that this was working a couple of weeks ago, and it just stopped working this week. We haven't added any new plugins and we haven't updated any existing plugins.

We do not have any caching on the site.

Also, we noticed when viewing the page listed in my private reply on Google Chrome that some sort of pop-up is blocked. Any idea why there is a pop-up showing? Could this be related to the issue with the query filter?

Thanks in advance!

#624227

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

Thanks for the update.
Also the popup is related to the debugging with views but it only appears for admin.

Would you mind if I took a duplicator package from the website for further debugging on this issue ?

Thanks,
Shane

#624263

Hi Shane,

Okay, great. Thanks for the info about the pop-up.

Sure, please create a duplicator package of the site. Let me know if you need anything from me.

Thanks!

#624648

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

Just letting you know that im still working on this for you.

An update is that i'm not able to replicate this on a fresh install. Is this the only view that you are experiencing the issue ?

Please let me know.
Thanks,
Shane

#624655

Hi Shane,

Thanks for the update. Yes, this is the only view that is not working correctly. We haven't noticed any other views that are not working correctly.

Thanks.

#625102

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

Thanks for the update.

Sorry for the delay in response but i'm still working on this.

Would you mind as a quick test to create a new view for this and let me know if you're experiencing the same issue.

Thanks,
Shane

#625351

Hi Shane,

Sure, I just created a new view and it did not work. When I added the query filter, it still showed all of the users instead of the users that matched the query filter.

#626224

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Zach,

It could be that there is something wrong with this user. Would you mind deleting and re-creating this user? I've also escalated this ticket so that our team can debug and have a look as well.

Since its only appearing with this view and we've already tried recreating the view, maybe something is wrong with the user.

Please let me know if this works.
Thanks,
Shane