Skip Navigation

The Events Calendar triggers database errors on Toolset Dashboard

Resolved

Reported for: Toolset Types 3.3.12

Topic Tags: Types plugin

Symptoms

Activating The Events Calendar plugin triggers the following errors when visiting the Toolset Dashboard:


WordPress database error Unknown column 'EventStartDate' in 'order clause' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND wp_posts.post_type = 'tribe_events' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'tribe-ea-success' OR wp_posts.post_status = 'tribe-ea-failed' OR wp_posts.post_status = 'tribe-ea-schedule' OR wp_posts.post_status = 'tribe-ea-pending' OR wp_posts.post_status = 'tribe-ea-draft' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private') ORDER BY EventStartDate DESC, wp_posts.post_date DESC LIMIT 0, 1
WordPress database error Unknown column 'EventStartDate' in 'order clause' for query SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'publish')) ORDER BY EventStartDate DESC, wp_posts.post_date DESC LIMIT 0, 1

Workaround

The Events Calendar automatically intercepts and modifies any query for its event post type, which in contexts other than its own plugin code can have unwanted results, including provoking such errors.

The Events Calendar introduced this problem, which affects other plugins, too, and they will fix this issue themselves in their next update.

In the meantime as a workaround you can apply the following patches:

Replace the file plugins/types/application/models/helper/placeholder.php with the zipped patch available here

Replace the file plugins/types/application/models/helper/condition/type/fields_assigned.php with the zipped patch available here

These will not be necessary once The Events Plugin releases the update.

Comments are closed