Home › Forums › Calendar Products › Community Events › Query bug (unknown column) in Events Calendar 4.4.3
- This topic has 4 replies, 3 voices, and was last updated 7 years, 2 months ago by Arjen.
-
AuthorPosts
-
February 26, 2017 at 7:45 pm #1246089ArjenParticipant
It appears a bug has crept into the events calendar 4.4.3:
Unknown column ‘wp_postmeta.meta_value’ in ‘field list’
Example query below, I believe this one is generated by the event list widget.
Once you alias a table (LEFT JOIN wp_postmeta as tribe_event_end_date) you can no longer refer to it by its base name (wp_postname), but only by its alias within the query (tribe_event_end_date).
However, the rest of the query still presumes it can address it by its base name, so the entire query fails with a syntax error.SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, MIN(wp_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate
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_postmeta.meta_key = ‘_EventStartDate’ )
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 = ‘private’)
AND (wp_postmeta.meta_value >= ‘2017-02-27 13:06:50’
OR (wp_postmeta.meta_value <= ‘2017-02-27 13:06:50’
AND tribe_event_end_date.meta_value >= ‘2017-02-27 13:06:50’ ))
GROUP BY wp_posts.ID
ORDER BY EventStartDate ASC, wp_posts.post_date ASC
LIMIT 0, 5February 26, 2017 at 7:49 pm #1246090ArjenParticipantBy the way, this issue was caught with “WP Query Analyzer”
A wonderful tool/plugin for WP developers.February 26, 2017 at 8:41 pm #1246099ArjenParticipantsorry you can scrap that, someone here made a booboo with a filter that ended up mucking with the queries.
February 27, 2017 at 6:33 am #1246187NicoMemberHey Arjen,
Thanks for reaching out to us and for the heads-up on the resolution of the issue 🙂
I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.
Best,
Nico -
AuthorPosts
- The topic ‘Query bug (unknown column) in Events Calendar 4.4.3’ is closed to new replies.