Skip Navigation

[Resolved] Views Query Filters overwrite filter values

This support ticket is created 4 years, 5 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 31 replies, has 3 voices.

Last updated by nickK-8 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1677021

I've got 3 containers, each with 1 View that I want to display the most recent 3 posts from different categories.

I had it all working offline and seemingly stable, but after a day of working on it, the Query filters for the different Views are all being overwritten by whatever the most recent change I've made to any other view. I'm assuming this isn't the expected behaviour?

Any assistance much appreciated!

#1677773

Hello and thank you for contacting the Toolset support.

It is not expected that the update of a view impacts other views. I understood, that the 3 views are altered each time you update any other view, right?
To better assist with this issue, I'll need to access your site or work on a copy of it, and I'll need an example of steps to follow to reproduce the issue. Similar to:
- Update the view xxx with ...
- Update the view yyy with ...
- Check the view xxx, ... has been changed.

I would prefer a copy of the site, so I can activate PHP debugging and disable/enable theme and plugins during my analysis.
Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1678085

Thank you for the access credentials and the detailed message.

I would say that the workflow that you use to update the views query filter is probably the cause of all these issues.

I'll first answer your question why aren't the query filters visible for all Views?
The view block contains internal blocks, like the view output, the view loop, search, and pagination if activated. You will need to choose the view block in order to be able to edit the query filter. For that, you can use the navigation button or the breadcrumbs at the bottom of the view. Check this screenshot hidden link

Currently, you have the following views in this content template:
- Hero Post
- Category_Design
- Category_Sustainability
- Category_SustainableLiving

I'll let you update the query filter for each view, and if you still encounter this overwriting issue, please describe what steps to follow to reproduce it.

Also, note, that this content template is assigned to the Page custom post type, all pages will use it unless they have another content template assigned to them on the page level. This may help with your second ticket. Shane will reply to it very soon.

#1678151

It sounds so much simpler when you say it!

Yes, of course you're right, the Query access is a lot simpler than I had it when you actually select the block properly! But selecting and doing it the right way is still giving me some overwriting/disappearing behaviour between the updating each block.

Could this also be a result of using the "edit copy" of each View when creating them? Essentially I created the Category_Design one and then created copies for the second two and then have created a very fine mess from there.

Are you able to see the overwriting behaviour at all when you look on your end? Or is it just me? It occurs to me that I could clear my own cache (not tried that yet), and of course, now that I know a little better, I could just delete the broken Views I've made and start over, making each one independently, if that might be an easier resolution.

#1678229

Maybe the fact of copying views contributed to this issue.

I do believe that recreating the whole page and creating views independently will be the easiest solution.

Feel free to get back if you still need assistance with anything.

#1678273

Hey Jamal - bad news I'm afraid.

So I removed and deleted the 3 old Views -- removed them completely. Cleared by browser cache. Remade the 3 views independently -- no copying (and doing it all a bit more quickly and smoothly, now that I'm slightly less crap with the app), but the queries are absolutely and very clearly overwriting each other with whatever the latest value is that's put into one of them.

Any other thoughts welcome. I'm using Opera browser for all my back end blog work ATM. Could that be an issue? Are there any better/worse browsers that you would recommend?

#1678775

Confirming that I get exactly the same result in Chrome with a fresh content layout and fresh set of Views, including having query filters applied to Views that didn't queries on them at all.

#1678827

And also confirming that loading each View individually they can work fine, but as soon as I try to load each previously 'good' View onto a single page, they each inherit the Query filter of the View loaded before.

I don't see what I could be doing that's user error at this point. Would love to have it pointed out to me.

#1679063

I wanted to check your new views and their results but the provided username/password are not working for me anymore. Can you provide another password on your next reply or update the provided credentials.
Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

Please provide an example that will help me see the issue. For example, the view xxx should return yyy but it returns zzz instead.

#1681003

Hi Jamal -- Have you had any luck getting to the bottom of the why these queries are not working correctly?

#1682229

My apologies for the late reply, I do not work on Sundays and Mondays.

Unfortunately, the user role does not allow me to access the admin area (/wp-admin) check this screenshot hidden link

Can you check it again?

#1682269

Completely understand. Sorry about that. Role has been updated now, you should be able to see what you need.

Thanks!

#1682987

From what I can see right now, the content template contains the following:
- View "Hero Post" filtered by category "Sustainability", check this screenshot hidden link
- View "Cat_Design" filtered by category "Sustainability" too, check this screenshot hidden link
- View "Cat_Sustainability" filtered by category "Sustainability" too, check this screenshot hidden link
- View "Cat_SustainableLiving" filtered by category "Sustainable Living", check this screenshot hidden link

Please note that the filter on stickiness will not be applied to custom post types, as you can see on the screenshots. As a workaround, you can use a custom field to mark a post as sticky or not, the custom field can be used in the view's query filter.

I wonder if you have created different filters for these views? What have you chosen before? What view did you update that you think has contributed to overriding the other views?

#1683021

Yeah exactly -- what you're seeing is the last state of "overwritten filters" where I've given up trying to correct them, because they all keep changing.

- "Hero Post" -- should have no category filter (and I never saved one onto it)
- "Cat_Design" -- filters by 4x categories: Design, How To, Collections, Designers (I've saved it as that multiple times, only to have it overwritten)

And the last two as you see them are as they should be, but keep also changing. I've not seen an exact behaviour, but generally it seems to be that whenever a query filter is updated it will update on the last 2 views edited (current and previous), but I've also seen it update all 4 views on the page, including the "Hero Post" which didn't previously have any query filters applied.

Thanks for the note on stickiness, I wasn't aware of that, but there's nothing here using custom post types. Is it possible that it's the stickiness that's messing with the filters generally? I've not tried removing that and it might line up with when I first saw this error. Can you test/confirm?

#1683467

So I've tested with removing any additional filters for stickiness and correcting the other queries, but I'm still seeing the same behaviours:

- "Hero Post" -- even having removed any query from this view, it still inherits the filters subsequently updated on other views.
- Same goes for all 3 of the Cat_ views: have setting each to filter by unique category options, they all display as filtering only for "Sustainable Living" (the last category updated).