[Resolved] View sometimes no returning any results
This thread is resolved. Here is a description of the problem and solution.
Problem: Sometimes a View that is filtered by a field from The Events Calendar is returning no results.
Solution: When using date filter operations, it's best to filter by a Types date field. TEC date fields are stored in the database using a different format, which can have unexpected results.
This support ticket is created 5 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.
Certainly would be logical - also given that I am dropping the Tribe Calendar soon and just going with a toolset solution - that would still bear fruit
Okay then I think the next step is to go through each View and check to see if the Ordering or Filtering is based on _EventStartDate. If so, update to the Event Start Date for Types field. Then clear all the caches and test the site. I'll be glad to do those steps in staging, unless you have any objection.
Go for it - I changed it in live this morning - my settings are now reflected as per the screenshot below - so there is no reference to that tribe field at all
I have yet to see the menu display 'No Events Found'
Okay done, I have checked all the Views in staging and updated ordering and filtering options in wp-admin such that ordering is based on Event Start Date for Types as a number, and all Query Filters are based on Event Start Date for Types as an UNSIGNED value. Those settings should produce the best results across the board, assuming all start dates have been translated from _EventStartDate to Event Start Date for Types successfully. What next steps should we take to try to reproduce the "No events found!" error? Edit some events, or add events? I'd like to try content changes before we add other plugins back to the mix.
Easiest - add a new event - check the custom fields that the function updates are updated - call it Christians New event or something - check it appears in the menus and other listings - assign me as guide - go to /with/david/ to check it appears there
OK check and check. CC Test Event now appears in the menu and on /with/david. I activated the child theme and the functions plugin to set those automatic field values.
I don't know how close the live site and the staging site are to each other, so I'm not the best judge of how to move forward here. Assuming everything is identical except for the few changes I made in Views to work with the Types field instead of the EC field, I don't think export / import is necessary. Edit all Views in the live site that utilize the _EventStartDate field for ordering or filtering. Switch those to use the Types field instead. You can create a backup of the database first, just to be extra cautious.
Christian - thanks for your help - the issue does not appear to be occurring with the amended views - next move is to dump TEC altogether - it does things in too odd a fashion for my liking