I've got a website which has been running Types and Views for some years now. It is an estate agent site, with a view showing property listings sorted by Price, which is a custom numeric field. Up until recently this has worked fine but for the last few months we've found that upgrading the Views plugin breaks the sort order.
I have created a copy of the site to troubleshoot.
Link to a page where the issue can be seen:
The original view can be seen here hidden link
And I've just created a new view with just title and price to see if creating it afresh helped (it didn't): hidden link
I expected to see:
A list of properties sorted by price ascending - so starting with the cheapest.
Instead, I got:
It looks like instead they are displaying chronologically by date of post - starting with the oldest.
Hello, I see the example you've provided and I would like to help get this working correctly again. Could you please follow these troubleshooting steps first to help pin down the source of the problem?
- Temporarily disable all plugins except Types and Views, then activate a default theme like Twenty Seventeen. If you need to use a plugin like Maintenance Mode to hide the site from users while making your changes that's fine. If the problem is resolved, please reactivate your theme and plugins one by one until the conflict is revealed.
- If the problem was not resolved by deactivating theme and plugins, look for the shortcode that adds this View onto the site in a Content Template or custom Page. Add the attribute cached="off" to the View shortcode and review the results. For example:
[wpv-view name="your-view-slug" cached="off"]
Let me know the results of these tests and we can go from there.
Thanks for getting back to me. As I've got a copy of the site to work on I can safely try any troubleshooting without breaking the live site.
I've followed your instructions:
1. The only plugins activated are Types and Views
2. The site is running the Twenty Fifteen theme
3. I've added the cached off to the shortcode:
[wpv-view name="All Properties - by Price" cached="off"]
You can see the results here: hidden link
As you can see the sort order by price field still isn't working.
Thanks again for your help. I'll look forward to your further advice.
Best wishes, Emily
Please update your Loop code to use wpv-items-found and wpv-no-items-found. If this still doesn't fix the sorting, I'll need to take a closer look in wp-admin. Please provide those login credentials in the private reply fields here.
Hmmm, not seeing anything obviously wrong. I turned on debug mode temporarily and it seems like the sorting settings for this View are being overridden somehow - usually this indicates another plugin or theme file altering queries. That's strange since your other theme and plugins are disabled. I'll create a clone of your site so I can install it locally and run some additional tests. Please stand by and I will update you shortly.
Actually, you can disregard that question for now. I need to reach out to my 2nd tier support team for a bit more clarification on this. Everything seems to be set correctly, but your sorting selections are not being respected for some reason I can't quite grasp. Thanks for your patience while I ask for some additional help, please stand by.
After a bit more investigation, our team has found that some of the Property Fields group data seems to be corrupted in the database, and resaving the Property Fields field group is the reccommended fix. Please go to Toolset > Post Fields and edit the Property Fields field group. Click "Save Field Group" - no changes are required. Then review the results on the front-end. Let me know if the problem is not resolved.
As Christian is currently on vacation, I will be handling his queue.
Since as mentioned the information could be corrupt the best plan to validate this and ensure that its not a bug is to recreate the view from scratch and see if the sorting works there.
Thanks for taking this on. Now, this is interesting. Before asking for help I had tried creating a new view but it had the same problem.
I've now created another one (just property name and price) and replaced the existing view with it here: hidden link
And that looks like it's working!
So, I'm guessing the answer is resaving the property fields and then creating a new view.
I will see if I can now follow this through and get the live site updated and working as it should. Is it ok if I leave this ticket open for the moment? As soon as I'm confident I've got this sorted I'll update to show it's resolved.
Thanks for updating me on this issue. The ticket will remain open for at least 30 days, however you will get some periodic reminders when an update is needed.