Undefined variable postmeta_table in /tribe-event-query.class.php on line 948

Home Forums Calendar Products Events Calendar PRO Undefined variable postmeta_table in /tribe-event-query.class.php on line 948

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #963874
    Ryan
    Participant

    Hi support,

    I am getting the following error when viewing event tags on my dev site http://www.aardkloplabs.co.za/en/tag/festival-terrain-concerts/

    I have tried removing the themes customisations but had no effect.

    I disabled all plugins and found that the error exists when WPML plugins are activated

    WPML Multilingual CMS
    WPML String Translation
    WPML Translation Management

    Please advise.
    Thanks
    Ryan

    Notice: Undefined variable: postmeta_table in /home/aardklzl/public_html/wp-content/plugins/the-events-calendar/lib/tribe-event-query.class.php on line 948

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ akwp_posts.post_date) AS post_date, tribe_event_end_date.meta_value as EventEnd’ at line 1]
    SELECT SQL_CALC_FOUND_ROWS DISTINCT akwp_posts.*, IF (akwp_posts.post_type = ‘tribe_events’, .meta_value, akwp_posts.post_date) AS post_date, tribe_event_end_date.meta_value as EventEndDate FROM akwp_posts INNER JOIN akwp_term_relationships ON (akwp_posts.ID = akwp_term_relationships.object_id) JOIN akwp_icl_translations t ON akwp_posts.ID = t.element_id AND t.element_type IN (‘post_post’,’post_tribe_events’) JOIN akwp_icl_languages l ON t.language_code=l.code AND l.active=1 LEFT JOIN akwp_postmeta as on akwp_posts.ID = .post_id AND .meta_key = ‘_EventStartDate’ LEFT JOIN akwp_postmeta as tribe_event_end_date ON ( akwp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = ‘_EventEndDate’ ) WHERE 1=1 AND ( akwp_term_relationships.term_taxonomy_id IN (19) ) AND akwp_posts.post_type IN (‘post’, ‘tribe_events’) AND (akwp_posts.post_status = ‘publish’ OR akwp_posts.post_author = 2 AND akwp_posts.post_status = ‘private’) AND t.language_code=’en’ GROUP BY akwp_posts.ID ORDER BY post_date DESC LIMIT 0, 10

    #964014
    Brian
    Member

    Hi,

    Sorry for the issues you are having.

    Unfortunately, our plugin and WPML do not work together all the time and there are issues that come up such as this and we do not have a fix for them.

    We are looking to make our plugin work better with WPML, but it is a rather big change and we do not have a timeline when that might happen.

    Let me know if you have any follow up questions.

    Thanks

    #964775
    Ryan
    Participant

    Hi Brian,

    Our theme developer came up with a solution to this issue. See his message below

    ——————————————–

    I think i found their error, they are missing a case to return a value. I just added an else statement.

    // check if are any meta queries
    if ( ! empty( $qv[‘meta_key’] ) ) {
    $postmeta_table = ‘tribe_event_postmeta’;
    } else {
    if ( isset( $qv[‘meta_query’] ) ) {
    if (
    ( is_array( $qv[‘meta_query’] ) && ! empty( $qv[‘meta_query’] ) ) ||
    ( is_a( $qv[‘meta_query’], ‘WP_Meta_Query’ ) && ! empty( $qv[‘meta_query’]->queries ) )
    ) {
    $postmeta_table = ‘tribe_event_postmeta’;
    } else {
    $postmeta_table = $wpdb->postmeta;
    }
    } else {
    $postmeta_table = $wpdb->postmeta; //Added this else statement
    }
    }
    return $postmeta_table;

    In this file: \wp-content\plugins\the-events-calendar\lib\tribe-event-query.class.php

    Approx line 948 ( Depending on the version )

    ———————————————–

    I implemented this and worked on my end.

    Please investigate.

    #965047
    Brian
    Member

    Thanks for the information, glad it is now working for you.

    I have included the information in our WPML compatibility ticket, but I do not have a timeline when those integrations might be included into the plugin.

    #973741
    Brian
    Member

    Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂

    #1001966
    Leah
    Member

    Hello,

    We are excited to report that our upcoming release, The Events Calendar 3.12, includes changes that greatly improve the compatibility between The Events Calendar and WPML. We’ve been working hard on this integration for some time and we want to specifically thank all of our users who requested and waited for this feature. We appreciate all of the support and patience!

    Version 3.12 of The Events Calendar will greatly improve compatibility with WPML, but we still have work to do. If you run into any problems integrating the two plugins, please post in our forums so that we can look into the issues. We’ll be on the look out for tweaks and fixes that will improve things further.

    Thank you again to everyone who has been waiting for this! The Events Calendar 3.12 is coming soon- watch your WordPress Updates page!

    Best,
    Leah
    and The Events Calendar team

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Undefined variable postmeta_table in /tribe-event-query.class.php on line 948’ is closed to new replies.