Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 13:00 9:00 – 13:00 9:00 – 13:00 8:00 – 12:00 8:00 – 12:00 -
- 14:00 – 17:00 14:00 – 18:00 14:00 – 18:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

This topic contains 6 replies, has 2 voices.

Last updated by joachimC-7 2 years, 2 months ago.

Assisted by: Bruno Kos.

Author Posts
February 7, 2022 at 12:15 pm

joachimC-7

Hi there,

I'm facing an issue with object cache for product reviews.
The problem is visible at:
hidden link
hidden link

When object cache is enabled there is only one language getting cached and displayed everywhere.
When the cache is disabled, English reviews are displayed on the "Reviews" page and French reviews are displayed on the "Avis" page.

February 7, 2022 at 12:56 pm
February 8, 2022 at 3:19 pm #10534685

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can I ask you the following? In order to debug this issue, I will install Duplicator plugin, will create packages and will try this on my localhost and escalate further to 2nd tier.

I will exclude all the media files, etc, to keep the package minimal.

https://wpml.org/faq/provide-supporters-copy-site/

Let me know if this is OK with you.

Regards,
Bruno Kos

February 8, 2022 at 3:36 pm #10534823

joachimC-7

Sure, no problem 🙂
By the way, note that this is a staging site with dummy content. Feel free to make any mods directly.
It's not a problem if it breaks and could be restored in one click if necessary.

February 9, 2022 at 8:11 am #10538615

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

This is escalated to our 2nd tier team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

Regards,
Bruno Kos

February 10, 2022 at 2:20 pm #10552159

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

This issue has been escalated to WPML developers. Apart from the workaround you already tried, there is nothing else we can provide at this point.

I will keep this thread updated as soon as I get any new information from them!

Regards,
Bruno Kos

February 11, 2022 at 7:40 am #10558071

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Instead of:

wp_cache_add_non_persistent_groups ('comment');

Can you try this?

add_action( 'pre_get_comments', function( WP_Comment_Query $commentQuery ) {
	$lang = apply_filters( 'wpml_current_language', null );
	
	$commentQuery->query_var_defaults['wpml_lang'] = $lang;
	$commentQuery->query_vars['wpml_lang']         = $lang;
} );

Regards,
Bruno Kos

February 17, 2022 at 3:54 pm #10605167

joachimC-7

That seems to work.
Is that something you plan to fix in WPML plugin code directly?