The code currently causing the errors which are forcing no events to show is in:
\themes\pesgb\includes\eventespressohelper.php
Any of the functions hooking into posts_join should first check to confirm if the table they are about to add as a join hasn’t been added already. Thats a relatively straightforward fix and a cuick example would be to go from this:
public static function filterEventLocationJoin($sql) {
// Use Event Espresso to get the names of event and event venue tables.
$eventVenueTable = EEM_Event_Venue::instance()->table();
$eventTable = EEM_Event::instance()->table();
// Construct join clause
$sql .= ' LEFT JOIN ' . $eventVenueTable .' ON '. $eventTable . '.ID = ' . $eventVenueTable . '.' . EEM_Event::instance()->primary_key_name();
// Pass SQL back.
return $sql;
}
To this:
public static function filterEventLocationJoin($sql) {
// Use Event Espresso to get the names of event and event venue tables.
$eventVenueTable = EEM_Event_Venue::instance()->table();
$eventTable = EEM_Event::instance()->table();
if (
strpos($sql, $eventVenueTable) === false
){
// Construct join clause
$sql .= ' LEFT JOIN ' . $eventVenueTable .' ON '. $eventTable . '.ID = ' . $eventVenueTable . '.' . EEM_Event::instance()->primary_key_name();
}
// Pass SQL back.
return $sql;
}
The only difference between those is the function checks is $sql already includes the table name value set in $eventVenueTable, if not, it adds it as a join. That will prevent multiple joins with the same table name (which is where the error is currently coming from).
However, I downloaded the site’s theme locally to find the above code location so I fixed those to confirm it worked on my local site, which it did, but then another fatal is thrown from constructing the event list items in your theme.
Fatal error: Uncaught Error: Call to a member function is_active() on string in /pesgb/partials/event-index-item-list.php on line 42
Thats this code $eventPost->EE_Event->is_active()
For you to be getting that error, it means EE_Event hasn’t been set. I tested version 5.0.17.p and it worked there, so this is from a recent change to how EE handles WP_Query.
The above code changes for functions using the posts_join filter should be done regardless, but EE_Event should also be set above and I’m not sure why it’s not. Fixing it can be done by adding some code to your template calls and that may well be the ‘proper’ solution for this but I’m going to open a discussion about it with our developers to check. In the meantime I can send you a copy of 5.0.17.p so your event list gets back up and running again if that helps?
Hi Tony, yes please if you can send version 5.0.17 and then if you could also somehow keep me updated about a fix as we regular update or plugins on the site.
Awesome. If you need anything, feel free to reach us again.
thanks
Viewing 17 reply threads
The support post ‘Events list view showing "Sorry no results"’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.