Skip Navigation

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

Problem:
The client is experiencing an issue where the calculation in WPForms does not work when both the WPForms Calculation Addon and WPForms Multilingual plugin are enabled.
Solution:
We have released an official workaround for this issue. We recommend following the steps outlined in the workaround to resolve the conflict temporarily. You can find the detailed instructions here: WPForms Calculations Not Working with WPForms Multilingual Enabled.
Please note that a permanent fix will be included in future releases of the WPForms Multilingual plugin.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us for further assistance.

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

Last updated by Christopher Amirian 3 months, 3 weeks ago.

Assisted by: Christopher Amirian.

Author Posts
August 28, 2024 at 7:50 am

marcoS-96

Background of the issue:
I am trying to resolve a conflict between the WPForms Calculation Addon and the WPForms Multilingual plugin. I have checked with WPForms, and they created a staging site copy on their WP Engine account. WPForms informed me that the issue is related to WPForms Multilingual plugin script requests. I replicated the issue and sent screencasts with the steps I followed. Here are the links: hidden link and hidden link. To replicate the issue: 1. Activate WPForms Multilingual 2. Update 'Valutazione Immobile con Calcoli': - go to a field (for example 'Andamento di Mercato') - select advanced - add or delete a space from Formula - save the form 3. Clear All Caches 4. Open the page where the form is inserted 5. Insert values in 'Quotazione a mq.' and 'Mq. Commerciali'. In this case, the calculation doesn't work. I leave the site with WPForms Multilingual enabled, but you can check by disabling/enabling. I can provide credentials to access the staging site. Link to a page where the issue can be seen: hidden link

Symptoms:
The calculation in WPForms does not work when both the WPForms Calculation Addon and WPForms Multilingual plugin are enabled.

Questions:
What is causing the conflict between WPForms Calculation Addon and WPForms Multilingual plugin?
How can I resolve the issue so that the calculation works correctly?

August 28, 2024 at 8:16 am
August 28, 2024 at 8:18 am #16113196

Christopher Amirian
Supporter

Languages: English (English )

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

Hi there,

I'd appreciate it if you could get back to us with the replicated issue and steps we need to take to see the problem.

I will then report the issue to the compatibility team.

Thank you.

August 28, 2024 at 9:25 am #16113766

marcoS-96

Hi Christopher,
I've set up WpForms and cretated a page for test wpform calculation:
hidden link

For checks you can refer to the fields with the yellow background.

I replicated the issue and I sent you screencasts with steps I followed (registrered from my staging site).

WPForms Calculation Addon and Multilingual disabled
hidden link

WPForms calculation addon and Multilingual enabled
hidden link

Please, try to do that to reply the issue:
1. Activate WPForms Multilingual
2. Update WpForm “Valutazione Immobile con Calcoli”:
- go to a field (for example “Andamento di Mercato”)
- select advanced
- add or delete a space from Formula
- save the form
3. Clear All Caches
4. Open page where form is inserted
5. Insert values in “Quotazione a mq.” and “Mq. Commerciali”

In this case calculation doesn’t works.

I leave site with WPForms Multilingual enabled, but you can check disabling/ enabling.

PS.: note that WpForm doesn't need to be translated from italian to english.

Many thanks,
Marco

September 1, 2024 at 11:59 am #16128939

Christopher Amirian
Supporter

Languages: English (English )

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

Hi Marco,

Sorry for the late reply. The issue is reported to the compatibility team. I will update you as soon as I have news.

Thanks.

September 3, 2024 at 1:40 pm #16135946

marcoS-96

Hi Christopher,
I await your reply.

Thanks.

September 6, 2024 at 11:16 am #16148691

marcoS-96

Hi Christopher,
any updates? Is the case working? How is it going?

Also, can I delete the staging site or would that be helpful?

Many Thanks, Marco.

September 7, 2024 at 2:46 pm #16151421

Christopher Amirian
Supporter

Languages: English (English )

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

Hi Marco,

Thank you for your patience, I have a question from the compatibility team:

I think I'm missing a piece here.

- In this form, the Andamento di Mercato field doesn't work with or without WPForms Multilingual:

hidden link">hidden link;

- In this other form, the Total field works with or without WPForms Multilingual:

hidden link">hidden link;

Could you please give it a look?

Also we are working on the "harmonious-clarinete.sandbox.otgs.work" website so I think it is ok to delete the other staging ones.

Thanks.

September 9, 2024 at 12:03 pm #16156043

marcoS-96

Hi Christopher,
I've made some checks and updates.

First I've added W3 Total Cache (useful to see page updated).
Then I've deleted all other WPForms addon, so now is active only WPForms Calculations.
WPForms Multilingual is disabled to test funcionalities.

In WPML languages I've changed default languages to Italian (please open as italian language - maybe it depends from that?).

In WordPress setting I've updated permalink structure:
from: Date and name
to: Article name

*** ITALIAN ***

In WPForms I've imported "Valutazione Immobile Con Calcoli" ID#107)

I created a page: "Test Valutazione Immobile" ID#75
hidden link

and added WPForm id #107 as:
1) Gutenberg WPForms block
2) Gutenberg Shorcode

I've also updated WPForm field ID #472 "Andamento di Mercato" formula

From
if ($F104 >= 0 ):
$F466 *($F104/100)
else:
$F466 * ($F104/100)
endif;

To
if ($F104 <> 0 ):
$F466 *($F104/100)
else:
0
endif;

Each time I have to test funcionalities I made and update in WPForm field ID #472 "Andamento di Mercato" formula, validate it and save form.

Than I restart SERVER PHP and clear SERVER CACHE.
You should try to do that from server site, not from WP dashboard.

Now in your Sanbox WPForms Multilingual is activated and calculation doesn't works.
If you disable WPForms Multilingual in Gutenberg WPForms block calculation works, but not in Shortcode block (in my staging site you can check that WPForms Multilingual doesn't activate WPForms calculation (for Gutenberg WPForms block AND Shorcode).

Many thanks,
Marco.

September 9, 2024 at 12:17 pm #16156195

Christopher Amirian
Supporter

Languages: English (English )

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

Hi Marco,

I honestly got very confused with the amount of information you mentioned and the mix between your and the sandbox.

Let's only focus on the sandbox as that is our main source of replication.

Would you please give me steps to see which Form to check to see if it worked or not when WP Forms Multilingual is enabled or disabled.
We need to show the compatibility team that the calculation is not working wen WP Forms multilingual is enabled and it WORKS when it is disabled.

Thanks

September 9, 2024 at 2:14 pm #16157051

marcoS-96

Hi Christopher,
you can check

from page:
hidden link

where is inserted:
WPForms "Valutazione Immobile Con Calcoli" ID#107)

Now in your Sanbox WPForms Multilingual plugin is activated and calculation doesn't works.

If you
1) disable WPForms Multilingual
2) update in WPForm field ID #472 "Andamento di Mercato" formula, validate it and save form.
3) restart SERVER PHP and clear SERVER CACHE
4) purge all caches: hidden link

...calculation works.

Many thanks,
Marco.

September 10, 2024 at 1:08 pm #16161650

Christopher Amirian
Supporter

Languages: English (English )

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

Hi,

Thanks, I created a video explaining the issue to the compatibility team.

I want to double check with you if I understood the problem correctly.

I'd appreciate it if you could check the video below and tell me if I am correct?

hidden link

Thanks.

September 11, 2024 at 7:15 am #16164549

marcoS-96

Hi Christopher,
yes it's correct.

Thanks.

September 11, 2024 at 9:03 am #16165305

Christopher Amirian
Supporter

Languages: English (English )

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

Thank you. I will get back to you as soon as I have an update from the compatibility team.

Thanks.

September 12, 2024 at 8:09 am #16169427

Christopher Amirian
Supporter

Languages: English (English )

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

Hi,

This issue is identified as a bug and reported to the development team.

This means that a fix will be available in upcoming releases of the WP Forms Multilingual plugin.

There is a temporary workaround that we did not test that has any side effects or not but it fixes the current issue.

You are welcome to implement the workaround on your own discretion:

- Open .../wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/SubLabels.php file.
- Look for line 12-13.
- Comment out these lines:

		// Hooks::onFilter( 'wpforms_save_form_args', 10, 2 )
		// 	->then( spreadArgs( [ $this, 'addFieldSubLabels' ] ) );

- resave the form.

Thank you.