Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is experiencing an issue with The Events Calendar Pro plugin where the titles of recurring events link to the first instance of the event instead of the correct instance when using the [tribe-events-list] shortcode. This issue occurs only when WPML is activated.

Solution:
We have identified two workarounds to address this issue (so far):

1. In WPML -> Settings -> Post Types Translation, set "Pages" to "Translatable - only show translated items".

2. If the first workaround is not suitable, add the following code to your theme's functions.php file:

add_filter ('the_content', 'remove_wpml_filter', 98, 1);
function remove_wpml_filter($content) {
    global $wp_filter;
    foreach ($wp_filter["the_content"]->callbacks[99] as $key => $value) {
        if(str_contains($key, 'fix_fallback_links')){
            remove_filter( 'the_content', $key, 99 );
        }
    }
    return $content;
}

Relevant Documentation:
- https://wpml.org/errata/the-events-calendar-recurring-event-instances-link-to-first-occurrence/

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 13 replies, has 2 voices.

Last updated by Jason 1 year, 4 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
November 7, 2023 at 5:43 pm #14750845

Jason

I am trying to use recurring events with The Events Calendar Pro plugin and show a list of upcoming events using the built in [tribe-events-list] shortcode.

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

I expected to see the titles linking to the correct instance of the recurring event.

Instead, the titles link to the first instance of the recurring event.

This only happens when WPML is activated. I've taken the site back to a default theme and only The Events Calendar Pro and WPML and the issue still happens. If I deactivate WPML, the titles link properly to their associated instance.

I've tried adding define( 'TEC_CUSTOM_TABLES_V1_DISABLED', true ); to my wp-config to use the old recurring events system but it has the same behaviour.

Is this bug being worked on? Is there a workaround?

November 8, 2023 at 7:51 am #14753199

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Jason,

Thank you for contacting the support.

I just checked the said URL and its translated version (hidden link), but I can see all events having their own date based URLs. I also opened a few to check if there are any recurrence shown but those were of the same day.

Can you please provide a URL where I can see the recurring events with said issue? A screen recording would be great for better understanding. Or perhaps I am missing about how to observe this - please advise.

On the other hand, I'll advise to update WPML plugins to the latest versions and try again. Remember to take full backup beforehand.

Looking forward.

November 9, 2023 at 2:53 am #14761947

Jason

Hello. The URL provided does show the issue.

For instance, the Systems Change Collaborative - Series shows a date of November 10th. It is the 3rd date in its series. It should link to the event instance ending in /2023-11-10/ but instead it links to the first instance of the series which is /2023-09-15/

November 9, 2023 at 8:26 am #14763043

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

November 13, 2023 at 5:45 am #14785355

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access and the details.

I am working on it and 'll get back to you accordingly.

November 13, 2023 at 11:16 am #14787753

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting on this.

I am able to see the problem as you mentioned. I need to reproduce this in a separate fresh installation to eliminate any chance of the stuff being affected by the DB or your server settings. For this, I'll need to take the event plugins (base and pro) from your site, as well as, copy some settings (as you've setup).

Please let me know if this is OK for you? I'll install these plugins and the settings in a sandbox site and share with you after reproducing (as well as with my team).

November 16, 2023 at 3:22 am #14821571

Jason

Sorry, the notification of your last reply went to spam... Yes, absolutely. Please proceed.

November 16, 2023 at 6:23 am #14822099

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the confirmation. I am working on it and 'll get back to you accordingly.

November 16, 2023 at 2:24 pm #14827811

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Just wanted to update you that I am still working on this and 'll get back to you accordingly.

November 21, 2023 at 6:42 pm #14890179

Jason

Wow... I don't know how the issue is not reproduced on your sample site. I've gone through all the settings and adjusted things slightly to make things exactly like it is on our site and I still can't reproduce the issue.

So I set up a brand new staging site on another environment that I have, starting from scratch, and I was able to reproduce the issue. I don't know what is different about yours... Here are the steps that I took:

1. On a cPanel account with PHP 7.4, I used WP Toolkit to create a fresh WordPress install in a subfolder: hidden link
2. Logged in to WordPress (6.4.1), deleted the Hello Dolly and Akismet plugins and first installed The Events Calendar (6.2.8.1), then uploaded The Events Calendar Pro (6.2.4), then uploaded WPML (4.6.7) and String Translation (3.2.8) plugins.
3. Left the theme as the default installed Twenty Twenty-Four.
4. Went through the WPML setup process to add French as the second language and left everything else as default settings and set up a new site in my WPML account to apply a valid license key.
5. Went to WPML -> Settings and updated the Post Type settings to be "Translatable use translation if available or fallback to default language" for Posts, Pages, and Events (like it is on our live setup).
6. Then created an Event back dated to a couple weeks ago and added a weekly recurrence for until the end of December and Published.
7. Then created a Test page and added the [tribe_events_list] shortcode on it.
8. Then updated the Permalinks settings to use Post Name.
9. Then tested my test page and found that all event links on my recurring event are linking to the first instance of the series.

Are you able to reproduce the issue if you follow the above steps on a new install? Maybe the install order matters...

I can provide you with access to the staging site that I set up if you'd like to compare.

November 23, 2023 at 5:01 am #14903543

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Apparently I followed the same steps in that sandbox site. However, it would be great if you can provide the access to the new staging site where the issue is reproduced? I hope this new one is using a minimal setup, right?

I'll observe this new staging, 'll try again in a fresh setup.

Besides this, please also allow if I can download the staging site as duplicator package? In case if I am not able to reproduce, I'll use the package to try locally, as well as, to forward to 2nd tier for detailed investigation (if needed).

I've enabled your next reply as private.

November 24, 2023 at 6:18 am #14913251

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I was able to observe the problem in your staging. I've created another duplicator package after testing a few things.

I've escalated the issue to our 2nd tier team for further investigation. Please keep the access to the staging site open in the current state. I'll update you as soon as I've more information.

Please note that due to the weekend, it may take a little longer. Your patience is highly appreciated in this regard.

December 6, 2023 at 9:56 am #15005721

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Our team investigated the problem and found 2 workarounds.

Workaround #1:
In WPML -> Settings -> Post Types Translation, if you set the "Pages" to "Translatable - only show translated items", then it works just fine. Currently it is set to "Translatable - use translation if available or fallback to default language" and causes the problem.

Workaround #2:
Instead of #1, you can add following code to your theme's functions.php file:

add_filter ('the_content', 'remove_wpml_filter', 98, 1);
function remove_wpml_filter($content) {
	global $wp_filter;
	foreach ($wp_filter["the_content"]->callbacks[99] as $key => $value) {
		if(str_contains($key, 'fix_fallback_links')){
			remove_filter( 'the_content', $key, 99 );
		}
	}
	return $content;
}

and it solves the problem.

I've tested both in your staging site. Currently I've applied workaround #2, instead of changing the translation settings for Pages.

Please check and use whatever is suitable for you. And let me know.

December 7, 2023 at 6:33 pm #15020253

Jason

Interesting! Thank you so much for the time spent figuring this out! I've used Workaround #2 and it indeed resolves the issue.

Not sure what the fix_fallback_links callback does, but I'll hope that we don't need it. I'll you know if the fix causes any other issues in our setup.

Cheers.