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.

This topic contains 8 replies, has 3 voices.

Last updated by Prosenjit Barman 1 year, 9 months ago.

Assisted by: Prosenjit Barman.

Author Posts
February 22, 2023 at 1:26 pm #13089413

pierreB-13

Hi

I have a Gravity Form on a page. As soon as I upgrade the Gravity Forms Multilingual plugin to 1.7 (or 1.7.1) I'll get the following Fatal error which prevents me from loading the site:

Fatal error: Uncaught TypeError: GFML_Conditional_Logic::translate_rule_value(): Argument #1 ($field) must be of type GF_Field, array given, called in /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/classes/class-gfml-conditional-logic.php on line 102 and defined in /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/classes/class-gfml-conditional-logic.php:187 Stack trace: #0 /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/classes/class-gfml-conditional-logic.php(102): GFML_Conditional_Logic->translate_rule_value(Array, 'gravity_form-1', 0, Array) #1 /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/classes/class-gfml-conditional-logic.php(41): GFML_Conditional_Logic->translate_rules(Array, 'gravity_form-1', Array, Array) #2 /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/classes/class-gfml-conditional-logic.php(23): GFML_Conditional_Logic->translate_rules_for_section(Array, 'gravity_form-1', 'notifications') #3 /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/inc/gravity-forms-multilingual.class.php(961): GFML_Conditional_Logic->translate_conditional_logic(Array, 'gravity_form-1') #4 /Users/aaron/Sites/wpblank.local/wp-content/plugins/gravityforms-multilingual/inc/gravity-forms-multilingual.class.php(848): Gravity_Forms_Multilingual->translate_conditional_logic(Array) #5 /Users/aaron/Sites/wpblank.local/wp-includes/class-wp-hook.php(310): 

Downgrading the plugin to v1.6.3 makes it work again without errors.

I've also reproduced the issues on a blank new WP install that only has the following plugins active:
- Gravity Forms 2.7.1
- Gravity Forms Multilingual 1.7.1 (or 1.7.0)
- WPML Multilingual CMS 4.5.14
- WPML Media Version 2.7.1
- WPML String Translation 3.2.3

All I did other than that is import the form (using the json import of Gravity Forms) and inserted that on a page through Gutenberg.

What worked is creating a blank new form with some fields, so something in that form seems to cause an issue related to the plugin update...I cannot spot the source of the problem though.

Here is a link to the form import json: hidden link

Thanks for help
Aaron

February 23, 2023 at 1:54 pm #13100037

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for reaching out to us. I will try my best to assist you in this matter.

Thanks for sharing the JSON of the Form. I imported that into my development environment and encountered the same Fatal Error.

The Error log indicates that the error is involved with the Conditional feature of Gravity Form. So, I started checking the Conditional logic applied to that specific form and successfully been able to trace the root cause.

There were two identical notifications created for that form, and the "Herzlichen Glückwunsch (voucher)" notification was set to inactive. Now, a conditional logic based on a field (Gewonnen) within the form is applied inside the "Herzlichen Glückwunsch (voucher)" notification and the same logic is used in another notification named "E-Mailadresse bestätigen (not voucher)".

As soon as I remove the conditional logic from the notification named "Herzlichen Glückwunsch (voucher)", the fatal error disappeared, and the form started displaying correctly. Please check this video to get a better understanding: hidden link

In my opinion, this issue could be caused by using the same logic in different notifications. Please make the adjustments as shown in the video for now, and I hope the issue will be resolved on your end as well. Please be assured that I will also discuss this matter with the second tier and see if there is anything we can do to address it.

Let me know if that helps or if you need further assistance in this matter. I will be happy to assist you.

Best Regards,
Prosenjit

February 27, 2023 at 5:52 pm #13127797

juliav-5

I have the same problem and downgrading fixed it for now.

But I need to send the admin-notifications based on the ICL_LANGUAGE_CODE to different mail addresses, so I can't remove the conditional logic from the notifications.

Although if "same" means that the conditional logic is the same in all notifications, that's not true here. I have 6 languages and 6 notifications that all check if ICL_LANGUAGE_CODE equals either "de", "en", "fr", and so on.

February 28, 2023 at 7:25 am #13131607

pierreB-13

Hey Prosenjit

Thanks for locating the source of the problem and for the video to show a possible workaround.

However I think the answer is not satisfactory. Your workaround would actually mean that we cannot use the conditional logic feature anymore in form notifications - which is an official functionality of Gravity Forms and is often times very much needed.

In the meantime I also reproduced the same issue by creating a new form containing a single text field, then only adding a conditional logic in the single admin notification. This fatally breaks the page with the same error as described above. Disabling the Gravity Forms Multilingual plugin would make the site work again (but is also a bad option).

It seems to me that clearly the update of Gravity Forms Multilingual to 1.7 breaks that functionality somehow, and should therefore be fixed as far as I understand.

Could you please check with your team again for providing a fix?

Thanks very much
Aaron

March 1, 2023 at 5:23 am #13141413

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello Aaron,
I hope this message finds you well.

I would like to inform you that I have successfully reproduced the issue that you reported in my development environment. After adding simple conditional logic to a form's notification, I was able to replicate the fatal error that you described.

Based on my initial investigation, it appears that the problem may be related to a class handling conditional logic. However, to gain a deeper understanding of the issue and identify its root cause, I have already escalated the matter to our second-tier support team.

Rest assured that I will keep you updated on any progress we make toward resolving this issue. I understand the inconvenience that this issue may have caused, and I appreciate your patience in this matter.

Thanks for bringing this issue to our attention. Let me know if there is anything else I can help you with.

Best regards,
Prosenjit

March 1, 2023 at 6:23 am #13141547

pierreB-13

Hey Prosenjit

thanks for the info. Looking forward to a fix 🙌🏻

Best greetings from Switzerland
Aaron

March 2, 2023 at 5:04 am #13151049

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing fine.

I'm pleased to inform you that the team has found a solution to the issue. We've published an errata with the workaround already, as other users may encounter the same problem.

Please check the errata at this link and apply the mentioned workaround accordingly on your site: https://wpml.org/errata/gravity-forms-multilingual-fatal-error-uncaught-typeerror-argument-1-passed-to-gfml_conditional_logictranslate_rule_value/

The issue will be solved right after that. Let me know if that helps or if there is anything else I can help you with. I will be happy to assist you.

Best Regards,
Prosenjit

March 2, 2023 at 10:46 am #13153653

pierreB-13

Hi Prosenjit

Thanks for the workaround. I can confirm that making the manual adjustment on the plugin as described in the errata fixed the error.

For our production site I would however prefer to stay on 1.6.3 until an update of the plugin containing the fix is released. When are you planing on releasing that?

Thanks again, Aaron

March 3, 2023 at 3:00 pm #13165005

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

I would like to inform you that the development team is currently working on adding the solution to the Gravity Form Multilingual plugin. I'm very sorry to inform you that I don't have any ETA on when the fixed version is going to be released.

But, If I get any update, I will surely let you know. Till then, feel free to use the Workaround mentioned in the Errata.

Let me know if there is anything else if you need help with.

Best Regards,
Prosenjit