Skip Navigation

[Resolved] Query Filter on Views is no longer filtering properly

This support ticket is created 4 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 22 replies, has 2 voices.

Last updated by webadmins 4 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1597919

I am trying to:
Set content order based on a "Order" number custom field. This had been working correctly until last week.

Link to a page where the issue can be seen:
hidden link

I expected to see:
The content ordered based by the custom field, "order", on the each component.

Instead, I got:
The view ignores the order number and filters on the secondary sorting which is by each components post date.

#1598597

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jason

Were some changes made to the site a week ago?

If the ordering is not being respected and it was working then it sounds like interference from some other code (that was maybe updated).

I'm guessing this is a staging site?

Can you check if ordering is still wrong if you disable all plugins except Types and Views? And if you switch theme to twentytwenty?

Try turning on Views debug mode (at Toolset > Settings > Front-end Content) which will add a debug pop-up on the page with the View that will let you inspect the query arguments (and generated SQL statement) to verify whether Views is trying to specify the ordering correctly. (If this is a staging site and you leave debugging on, I'll be able to check, too.)

#1599557

Thanks for the Reply Nigel.

I'm going to turn on debugging right now so you can take a look at the query. I took a look a look as well and nothing immediate jumped out. We did have an employee making soome changes to some custom fields but I backed out most of them.

#1599717

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I'm not seeing the debug window when I visit the page.

Let me set a private reply to get access credentials from you. I'm actually done for the day and I'm pretty sure we're in different timezones, so if I get them from you now I can look straight away when I start.

#1603239

Hey Nigel, I'm getting your credentials squared away and I will reply with them.

#1603247

Hey Nigel, is there any way we would be able to do a web conference and I can pass you my credentials? ou drive and Im in the passenger? Working from home for the time being so I can essentially be available whenever you need.

#1603613

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

You can just fill in the fields in this private reply (I'll set another one for you now).

It will ask for the WP admin credentials as well as FTP, but I don't actually need FTP you can fill that with dummy text.

No-one can see the private replies (and when this thread is resolved they are automatically deleted from the system, so there is no permanent record).

I recommend rather than giving me your own credentials, you create a new temporary admin user and share the credentials for that, and as soon as we are done you can delete that user.

#1605173

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-04-29 at 08.31.01.png

Thanks for those.

Are you using a customiser for the admin menus?

Most of the Toolset menu options are hidden so I can't do very much (screenshot), and I notice things like the Settings menu are missing.

I couldn't spot such a plugin in the plugins list, but something has modified the dashboard menus.

Can you disable that?

#1605927

Terribly sorry let me fix this for you. I added back all the permissions of a regular admin so you should be in the clear now.

#1606019

To add more clarity, the specific issue lies within our E-D components custom post type. The other CPT are working as normal but the views that use the E-D Component and order the content by the order number field are the ones not responding.

#1606681

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I can see with the debugging info for Views that it is set to order by the Order custom field but doesn't, and I need to do some more debugging work to find out why.

Your version of Views wasn't up-to-date and the site on this server isn't registered, so I deleted Views so that I could manually upload the current version, that triggered an error, I couldn't complete it (a limitation on your server uploads, I think, nothing to do with the plugin itself).

So, I've taken a copy of your site to install locally to work on, but your site is currently missing Views.

I'll update here when I have some results.

#1607229

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I registered your site with Toolset using my account so that I could get the latest version of Views installed to check something, but it hasn't helped, though you do now have Views installed and active again.

I'll keep testing.

#1607289

Thanks Nigel.

Hate to snowball on top of you but there is also one more issue thats prevalaent relate to toolset. It pertains to the conditional logic for three fields:
1. Button Link 2
2. Button Text 2
3. Button Color 2.

These are all custom fields with conditional logic used with the E-D Component Custom Post Type.

The logic in those fields mirror production but they are disabled and hidden when trying to use them. Im just not sure why the logic is disabling them but all of the issues seem to stem from somethign going on with the E-D Component Post Type.

I can open another ticket to address these issues separately if needed.

#1607923

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Thanks for that, it is likely related, I'll check.

I had found on my local copy of your site if I deleted all the other fields in the custom field group for E-D Components than the Order field and re-saved the group then the View worked correctly.

The problem appears to be related to the custom field group (rather than the post type) and I'm trying to focus in on what specifically is the cause.

I'll take a closer look at those fields (and the fields their conditions depend on).

#1608099

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jason

I found that both the problem with saving the large custom field group *and* the actual problem with the View not using the custom field for ordering were resolved by raising the PHP max_input_vars.

In my case I raised it to 5000, I didn't try to finesse what minimum value was required.

I guess your staging server has different settings to your production server.

In any case, can you please try the same and let me know if that resolves the problems.