{"id":1003840,"date":"2015-09-10T12:18:26","date_gmt":"2015-09-10T19:18:26","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/"},"modified":"2015-09-26T07:05:04","modified_gmt":"2015-09-26T14:05:04","slug":"wpml-tribe_events-query-trouble-whats-wrong-here","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/","title":{"rendered":"WPML &amp; tribe_events query = trouble! What&#039;s wrong here?"},"content":{"rendered":"<p>Hello:<\/p>\n<p>I suppose I can ask about WPML now that it&#8217;s supported! Congrats to everyone. Very happy to see official compatibility.<\/p>\n<p>That said, I&#8217;m running into the following problem:<\/p>\n<p>I&#8217;m using WP_Query to display posts (e.g., <code>post<\/code>) and <code>tribe_events<\/code>. Essentially, recent news posts and upcoming events.<\/p>\n<p>Works perfectly in English, but in French, I get a giant error message.<\/p>\n<p>Here&#8217;s my query:<\/p>\n<pre><code>$args = array (\n&#039;post_type&#039;              =&gt; array( &#039;post&#039;, &#039;tribe_events&#039; ),\n&#039;posts_per_page&#039;         =&gt; &#039;5&#039;,\n);\n\t\t\t\t\t\n$query = new WP_Query( $args ); <\/code><\/pre>\n<p>Etc. When I take out <code>tribe_events<\/code> it works properly in French. With it there, I get this message:<\/p>\n<p><code>Notice: Undefined variable: postmeta_table in \/Users\/SPS\/Sites\/hepac2015\/wp-content\/plugins\/the-events-calendar\/src\/Tribe\/Query.php on line 960<\/code><\/p>\n<p>and<\/p>\n<pre><code>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 &#039; wp_posts.post_date) AS post_date FROM wp_posts JOIN wp_icl_translations t ON &#039; at line 1]\nSELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = &#039;tribe_events&#039;, .meta_value, wp_posts.post_date) AS post_date FROM wp_posts JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type IN (&#039;post_post&#039;,&#039;post_tribe_events&#039;) JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1 LEFT JOIN wp_postmeta as on wp_posts.ID = .post_id AND .meta_key = &#039;_EventStartDate&#039; WHERE 1=1 AND ( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (49) ) ) AND wp_posts.post_type IN (&#039;post&#039;, &#039;tribe_events&#039;) AND (wp_posts.post_status = &#039;publish&#039; OR wp_posts.post_status = &#039;acf-disabled&#039;) AND t.language_code=&#039;fr&#039; GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 1 <\/code><\/pre>\n<p>Help?<\/p>\n","protected":false},"template":"","class_list":["post-1003840","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -\" \/>\n<meta property=\"og:description\" content=\"Hello: I suppose I can ask about WPML now that it&#8217;s supported! Congrats to everyone. Very happy to see official compatibility. That said, I&#8217;m running into the following problem: I&#8217;m using WP_Query to display posts (e.g., post) and tribe_events. Essentially, recent news posts and upcoming events. Works perfectly in English, but in French, I get [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-09-26T14:05:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/\",\"name\":\"WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2015-09-10T19:18:26+00:00\",\"dateModified\":\"2015-09-26T14:05:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"WPML &amp; tribe_events query = trouble! What&#039;s wrong here?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/","og_locale":"en_US","og_type":"article","og_title":"WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -","og_description":"Hello: I suppose I can ask about WPML now that it&#8217;s supported! Congrats to everyone. Very happy to see official compatibility. That said, I&#8217;m running into the following problem: I&#8217;m using WP_Query to display posts (e.g., post) and tribe_events. Essentially, recent news posts and upcoming events. Works perfectly in English, but in French, I get [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/","article_modified_time":"2015-09-26T14:05:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/","name":"WPML &amp; tribe_events query = trouble! What&#039;s wrong here? -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2015-09-10T19:18:26+00:00","dateModified":"2015-09-26T14:05:04+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/wpml-tribe_events-query-trouble-whats-wrong-here\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"WPML &amp; tribe_events query = trouble! What&#039;s wrong here?"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1003840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1003840\/revisions"}],"predecessor-version":[{"id":1004028,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1003840\/revisions\/1004028"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1003840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}