Home › Forums › Calendar Products › Events Calendar PRO › WPML & tribe_events query = trouble! What's wrong here?
- This topic has 4 replies, 3 voices, and was last updated 10 years, 6 months ago by
Support Droid.
-
AuthorPosts
-
September 10, 2015 at 12:18 pm #1003840
Sean Sullivan
ParticipantHello:
I suppose I can ask about WPML now that it’s supported! Congrats to everyone. Very happy to see official compatibility.
That said, I’m running into the following problem:
I’m using WP_Query to display posts (e.g.,
post) andtribe_events. Essentially, recent news posts and upcoming events.Works perfectly in English, but in French, I get a giant error message.
Here’s my query:
$args = array ( 'post_type' => array( 'post', 'tribe_events' ), 'posts_per_page' => '5', ); $query = new WP_Query( $args );Etc. When I take out
tribe_eventsit works properly in French. With it there, I get this message:Notice: Undefined variable: postmeta_table in /Users/SPS/Sites/hepac2015/wp-content/plugins/the-events-calendar/src/Tribe/Query.php on line 960and
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 ' wp_posts.post_date) AS post_date FROM wp_posts JOIN wp_icl_translations t ON ' at line 1] SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = 'tribe_events', .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 ('post_post','post_tribe_events') 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 = '_EventStartDate' 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 ('post', 'tribe_events') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled') AND t.language_code='fr' GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 1Help?
September 10, 2015 at 5:45 pm #1004030George
ParticipantHey Sean,
Sorry you’re having some trouble here! Just to be clear, if you deactivate WPML but keep tribe_events in the query, do things work there too? Or does the error remain?
This test will help reveal if the extent of the problem here is just WPML and the multilingual events configuration, or if there are other factors at play here too.
Let us know what you find!
Thanks,
GeorgeSeptember 11, 2015 at 6:19 am #1004172Sean Sullivan
ParticipantHey George:
Tried that, and it works fine. The site’s primary language is English, so like I said, the English query works fine. It’s when the tribe_events query runs in the translated language (French) that I get that error.
Here’s the error message, pasted instead of in code tags (sorry).
—
Notice: Undefined variable: postmeta_table in /Users/SPS/Sites/hepac2015/wp-content/plugins/the-events-calendar/src/Tribe/Query.php on line 960
Notice: Undefined variable: postmeta_table in /Users/SPS/Sites/hepac2015/wp-content/plugins/the-events-calendar/src/Tribe/Query.php on line 960
Notice: Undefined variable: postmeta_table in /Users/SPS/Sites/hepac2015/wp-content/plugins/the-events-calendar/src/Tribe/Query.php on line 960
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 ‘ wp_posts.post_date) AS post_date FROM wp_posts JOIN wp_icl_translations t ON ‘ at line 1]
SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, IF (wp_posts.post_type = ‘tribe_events’, .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 (‘post_post’,’post_tribe_events’) 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 = ‘_EventStartDate’ 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 (‘post’, ‘tribe_events’) AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘acf-disabled’ OR wp_posts.post_author = 13 AND wp_posts.post_status = ‘private’) AND t.language_code=’fr’ GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 1—
I found another user with a similar problem on the forum — https://theeventscalendar.com/support/forums/topic/undefined-variable-postmeta_table-in-tribe-event-query-class-php-on-line-948/ — but that solution didn’t work for me. (I think the problem has already been resolved in a TEC update).
Thanks.
September 11, 2015 at 9:42 am #1004340George
ParticipantHey Sean,
I’m sorry to report this, but I think the extent of this problem is simply the incompatibility between The Events Calendar and WPML 🙁
WPML does many odd things that are prone to breaking queries, URL rewrites, all sorts of stuff. It’s a great plugin, just a complicated one with its code affecting many disparate things.
We have many known compatibility issues with WPML and this unfortunately seems to just be another one. I’m sorry that we don’t have a fix for this yet – starting with the 3.12 release that came out just this week, we’re making a commitment to compatibility fixes with WPML in our development budget. I’m sorry but unfortunately this means that my best news for this issue is to hope that the next updates for The Events Calendar and Events Calendar Pro fix this – I can’t promise that they will, as other compatibility issues with WPML might be taking precedence, but I will make sure this issue stays on our radar.
I’m really sorry about this, Sean, and wish I had something more substantive to share with you here!
September 26, 2015 at 7:05 am #1008935Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘WPML & tribe_events query = trouble! What's wrong here?’ is closed to new replies.
