Skip Navigation

[Resolved] Multiple filters to use an AND rather than OR function

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 1 voice.

Last updated by Minesh 1 week, 3 days ago.

Assisted by: Minesh.

Author
Posts
#2788057

I have a distinct feeling that you are not trying to help me but to get rid of me.

This question does not pertain to the Time filter. The Time filter works just fine, even if it has some artefact fields left there. I am asking a question about the Topic / Tradition / Language filters which are clearly showing that the AND function between them does not work. Those were only done natively in Toolset by myself.

If you don't want to help me with this, please pass on this ticket to someone who will.

#2788065

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm afraid it is not like that.

Due to the custom filter you added, it adds the following to the view's query and that is why it seems to failed because by default it adds -3000 value to query filter.

(
( mt1.meta_key = 'wpcf-entry-year2' AND mt1.meta_value = '-3000' )
)

If you see the following reply from you:
=> https://toolset.com/forums/topic/multiple-filters-to-use-an-and-rather-than-or-function/#post-2786968

Notice the link you shared with above reply:

Here is a direct link that showcases the problem:
hidden link

And notice that it passes the &wpv-wpcf-entry-year2=-3000</storng> as a result it adds the following to view's query:

(
( mt1.meta_key = 'wpcf-entry-year2' AND mt1.meta_value = '-3000' )
)

I hope this clarifies and remove your doubt that we do actually want to help you but if you do not want to agree, we can not do much things here.

I suggest try to create a test page and another test view and to this view try to add the filters for Topic / Tradition / Language filters and check if this works well or not.

#2788122

I created a new View called Test View. It is identical except I completely removed the Time filter. I updated the /NewSearch page with the new view. The problem with Topics / Traditions / Languages persists. So it seems like whatever the problem was, it didn't come from there.

#2788483

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

There is something mustbe going on with the view you created.

I've created a following "toolset-test-view" and added all those filters as you can see with the following view:
=> hidden link

And when I search with the multiple fields as you can see with the following link:
=> hidden link

I can see it displays "No results found" message.

Can you pelase try to play with the above view and check by selecting multiple filters and check if you able to see the correct results.

#2788485

Yes, this one seems to return the results correctly. So how is that different from the NewSearch view?

#2788486

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I'm not sure - I suggest you should create a brand new view and then try to use that brand new view with the filters added manually one by one and check if that help you to resovle your issue.