This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 7 replies, has 3 voices.

Last updated by Black Studio 2 months, 1 week ago.

Assigned support staff: Raja Mohammed.

Author Posts
July 30, 2019 at 3:09 pm

arianeF-2

I am trying to: Two issues: First the recurring events won't work on Events Calendar Pro. I tried following the instructions and changed the setting from Classic Translations to Advanced and it made not difference. Events Calendar Pro support tells me this is a WPML issue. Related? I added advanced custom fields to my events and the translated events will not update. I tried deleting the translated event and re-creating the translations and they still don't show.

Link to a page where the issue can be seen: hidden link

Rather than give access to the site (I can if I have to) I've included Duplicator files.

July 31, 2019 at 5:34 am #4311565

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there,

This seems like a similar issue already reported by another client here https://wpml.org/forums/topic/recurring-events-not-showing-with-wpml-enabled/

Could you please confirm whether your issue is the same as the one in the above thread.
In that case, I would add your ticket to the escalated thread so that I can follow up with the compatibility team for further updates.

Kind regards
Raja

July 31, 2019 at 3:57 pm #4316291

arianeF-2

Thank you Raja, it does indeed seem to be a very similar issue. I know there have been several threads regarding this, and in the past the answer was to change from "Classic" to "Advanced" translation, but that doesn't seem to make a difference. I would appreciate if you would add our ticket to the escalated thread.

August 1, 2019 at 3:46 am #4318489

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for the confirmation,

Since we have some issue with the Events calendar our compatibility team suggest to use the default WordPress editor for translation

- Navigate to the event editing page. Use the admin bar language switcher to choose the desired secondary language you want to create the translated event instances for.

- You will see a warning pop-up about editing a translation using the standard WordPress editor. Click on the Edit anyway button.

- In the publish meta-box click on the Update button.

This will create the translated instances in the secondary language. Repeat the steps above to all the languages you have on your website.

let me know if that helps.

Kind regards
Raja

August 1, 2019 at 3:51 am #4318559

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

However, I can confirm there is an issue displaying recurring events when WPML is active. I have escalated to the compatibility team.

Kind regards
Raja

August 6, 2019 at 11:43 am #4346863

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi there, Thanks for your patience.

We have tested this issue again the workaround suggested in my previous reply works fine. that is the only way we can solve the issue in displaying the translated recurring events.

The Tribe Events Calendar plugin will create the recurring event once it is saved from the WordPress editor the process can only be triggered once the main event is saved again.

Please refer my previous reply https://wpml.org/forums/topic/wpml-with-events-calendar-pro-recurring-events-and-updates-not-working/#post-4318489

Kind regards
Raja

August 13, 2019 at 9:17 pm #4390825

arianeF-2

This issue is not resolved as the workaround is not working.

September 14, 2019 at 3:49 pm #4572943

Black Studio

Hi there,
I helped Ariane and Serena to fix this issue on their site.
The issue in displaying all the instances of a recurring event is due to a modification that occurs on the main query of the page.

I.e. With WPML disabled we would have a query like this:

SELECT wp_posts.*
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_posts.post_name = 'test-recurring-en'
AND ( wp_postmeta.meta_key = '_EventStartDate' )
AND wp_posts.post_type = 'tribe_events'
AND ((wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private'))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC

With WPML enabled the same query becomes:

SELECT wp_posts.*
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_posts.post_name = 'test-recurring-en'
AND wp_posts.ID = 3590
AND ( wp_postmeta.meta_key = '_EventStartDate' )
AND wp_posts.post_type = 'tribe_events'
AND ((wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private'))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC

As you can note a condition "wp_posts.ID = 3590" is added, which is responsible for showing up a single event rather than the complete list.

I was able to fix the issue with the following code snippet:

add_filter( 'wpml_post_parse_query', 'spark_wpml_post_parse_query', 100000 );
function spark_wpml_post_parse_query( $query ) {
	if (
		isset( $query->query_vars['p'] ) &&
		isset( $query->query['tribe_recurrence_list'] ) &&
		isset( $query->query['post_type'] ) &&
		$query->query['tribe_recurrence_list'] == 1 &&
		$query->query['post_type'] == 'tribe_events'
	) {
		unset( $query->query_vars['p'] );
		$query->query_vars['name'] = $query->query['name'];
	}
	return $query;
}

I hope that you can forward this to your compatibility team.
I am not sure if this should be handled on the WPML side, or on the "The Events Calendar" side.

All the best,
Marco
Black Studio