When I upgrade to the current EE Core (Event Espresso 4 Core Regular v5.0.19.p), my [ESPRESSO_EVENTS] shortcode stops working. When I enable WP_DEBUG, I see the following error on any page that contains the [ESPRESSO_EVENTS] shortcode. I check and the table “amsdb_esp_datetime” does exist, but there’s also a table “amsdb_esp_tickets”. I was able to get the [ESPRESSO_EVENTS] shortcode working again on my site by downgrading to EE Core 5.0.17.
SELECT SQL_CALC_FOUND_ROWS amsdb_posts.*, amsdb_esp_datetime.* , MIN( amsdb_esp_datetime.DTT_EVT_start ) as event_start_date
FROM amsdb_posts INNER JOIN amsdb_esp_datetime ON ( amsdb_posts.ID = amsdb_esp_datetime.EVT_ID ) INNER JOIN amsdb_esp_datetime ON ( amsdb_posts.ID = amsdb_esp_datetime.EVT_ID ) INNER JOIN amsdb_esp_datetime_ticket AS Datetime_Ticket ON ( Datetime_Ticket.DTT_ID=amsdb_esp_datetime.DTT_ID ) INNER JOIN amsdb_esp_ticket AS Ticket ON ( Datetime_Ticket.TKT_ID=Ticket.TKT_ID )
WHERE 1=1 AND ((amsdb_posts.post_type = ‘espresso_events’ AND (amsdb_posts.post_status = ‘publish’ OR amsdb_posts.post_status = ‘cancelled’ OR amsdb_posts.post_status = ‘postponed’ OR amsdb_posts.post_status = ‘sold_out’ OR amsdb_posts.post_status = ‘acf-disabled’ OR amsdb_posts.post_status = ‘wc-tec’
OR amsdb_posts.post_status = ‘private’))) AND amsdb_esp_datetime.DTT_EVT_end > ‘2024-03-25 19:53:55’ AND amsdb_esp_datetime.DTT_deleted = 0 AND Ticket.TKT_end_date > “2024-03-25 19:53:55” AND Ticket.TKT_deleted=0 GROUP BY amsdb_posts.ID ORDER BY event_start_date ASC LIMIT 0, 10
/* From [www.americanmedicalseminars.com/rob-testing/] in [/nas/content/live/ams4cme/wp-content/plugins/event-espresso-core-reg/core/domain/services/wp_queries/EventListQuery.php:77] */
I did try to use [ESPRESSO_EVENTS] in my 5.0.19 but i did not receive any problem. Do you have stagging site? can you try to check if there’s a plugin conflict that is going on? Did you also customized your shortcode or add some code snippet in your child theme or create plugin that is related to EE?
Where did you see the error? can you send screenshot of its location?
Hmm. I was able to get it working by removing the following filters from my functions.php file. Both sets of code came from EE Support Forums. Are either still necessary in newer versions of EE?
THE CODE I REMOVED:
/**
* The purpose of this snippet is to filter the event archive (and event taxonomy archive) pages so that they exclude events
* that have tickets no longer on sale.
*
* NOTE: This query is only valid for Event Espresso 4.8+
*
* To Implement this code, add it to the bottom of your themes functions.php file, or add it to a site specific plugin.
*
*/
function de_ee_tweak_event_list_exclude_ticket_expired_events_where( $SQL, WP_Query $wp_query ) {
if ( isset( $wp_query->query_vars[‘post_type’] ) && ( $wp_query->query_vars[‘post_type’] == ‘espresso_events’ || ( is_array( $wp_query->query_vars[‘post_type’] ) && in_array( ‘espresso_events’, $wp_query->query_vars[‘post_type’] ) ) ) && ! $wp_query->is_singular ) {
$SQL .= ‘ AND Ticket.TKT_end_date > “‘ . current_time( ‘mysql’, true ) . ‘” AND Ticket.TKT_deleted=0’;
}
return $SQL;
}
add_filter( ‘posts_where’, ‘de_ee_tweak_event_list_exclude_ticket_expired_events_where’, 15, 2 );
ooh yes, We have that Snippet reported. Our Developers made adjustment and it is under testing. Once it pass the test it will be available in the upcoming update.
If you can wait till the next version update, this issue will be resolved.
thanks
Viewing 4 reply threads
The support post ‘[ESPRESSO_EVENTS] shortcode in Event Espresso 4 Core Regular v5.0.19.p’ 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.