Skip to content Skip to sidebar

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

Problem:
I have a problem with WPML and Gravity Forms.

The issue occurs only when visiting the website for the first time or in incognito-mode.

Solution:

Installing this plugin helped me fix the issue: https://wordpress.org/plugins/fresh-forms-for-gravity/.

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.

This topic contains 5 replies, has 2 voices.

Last updated by wouterv-34 1 year, 10 months ago.

Assisted by: Christopher Amirian.

Author Posts
April 30, 2024 at 10:23 am #15580755

wouterv-34

Hello,

I have a problem with WPML and Gravity Forms.

The issue occurs only when visiting the website for the first time or in incognito-mode.

- Visit: hidden link
- Make sure the form is in Dutch language
- Go to step 2 and you see the language is switched to English. This only happens the first time. If you reload the form (make sure it's still in Dutch) ad go to step 2, the language doesn't change to English.
- The sudden change of language causes problems when continue to step 3.

I hope you can help me fix this issue.

step2b.JPEG
step2a.JPEG
April 30, 2024 at 3:52 pm #15582080

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

This seems to be a compatibility issue with WPML and Gravity Form. To be able to report the compatibility issues we need to replicate the issue on a clean installation.
I created a clean installation of WordPress, WPML, and all necessary WPML add-ons.
You can access the WordPress dashboard using the link below:

hidden link

Kindly follow the steps below:

- Install Gravity Forms.
- Create a multi-page form.
- Try to replicate the issue.

This will help us to report the probable issue to the compatibility team and solve the possible problem faster.

Thanks.

May 2, 2024 at 7:46 am #15585828

wouterv-34

Hi, I tried to reproduce the issue in the sandbox, but wasn't successful. I'll dig into the custom-made script on my site to see if one of those causes the issue.

Are you able to reproduce the issue on our site? And if so, do you see any errors in the console that give a hint where I can start looking?

May 2, 2024 at 10:09 am #15586556

wouterv-34

I did some extra debugging: turned all custom scrips on and off and tested the form again and again. It turns out the script below is causing the problem.

/**
 * hidden link
 */

add_filter( 'gfcb_enable_cache_buster', '__return_true' );

When I turn this script off, WPML translates the form fine. When I turn off on the script the translation breaks in step 2 and turns back to the default language. 

I need some kind of "cach buster" for the form to work properly (or else all kind of other issues show up), but when I turn it on WPML doesn't work properly.

What would be good to do in this case?

May 6, 2024 at 10:24 am #15596510

Christopher Amirian
WPML Supporter since 07/2020

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

This is outside of our support scope as we do not have any clue what a cache-busting method it is that you use and what it does to cause WPML crash.

I also checked WPML hooks to see if there is a cache related one there or not:

https://wpml.org/documentation/related-projects/woocommerce-multilingual/wcml-hooks-reference/

The only cache related thing that you can use is the one below, but I do not think it will have any relation with the current issue that you have as it is related to currency switching:

https://wpml.org/wcml-hook/wcml_is_cache_enabled_for_switching_currency/

I also did an entire search of our support forum and there is no instances of the code used in context with WPML to be able to help:

hidden link

Thanks

May 9, 2024 at 4:51 am #15608436

wouterv-34

Installing this plugin helped me fix the issue: https://wordpress.org/plugins/fresh-forms-for-gravity/.