Query bug (unknown column) in Events Calendar 4.4.3

Home Forums Calendar Products Community Events Query bug (unknown column) in Events Calendar 4.4.3

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1246089
    Arjen
    Participant

    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, 5

    #1246090
    Arjen
    Participant

    By the way, this issue was caught with “WP Query Analyzer”
    A wonderful tool/plugin for WP developers.

    #1246099
    Arjen
    Participant

    sorry you can scrap that, someone here made a booboo with a filter that ended up mucking with the queries.

    #1246187
    Nico
    Member

    Hey 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Query bug (unknown column) in Events Calendar 4.4.3’ is closed to new replies.