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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: ,

This topic contains 0 replies, has 0 voices.

Last updated by Kor 9 hours, 55 minutes ago.

Assisted by: Kor.

Author Posts
March 4, 2025 at 10:50 am #16773019

dominikN-6

Background of the issue:
Good morning everyone,
in our project we use WPForms, WPML and WPForms multilang. In a form we have a Repeater, which allows users to add another group of inputs dynamically. In this Repeater there are a Select form elements.
In this specific combination of elements/functionalities/plug-ins we're getting 500 Internal server error.
When we remove Select from Repeater, or when we deactivate WPForms multilang plug-in, the form submit works fine.
Please see code below what was returned by server.

Thank you for taking a look at this and letting us know. Have a great day!

Warning: Undefined array key "3_2" in /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php on line 92

Warning: Trying to access array offset on null in /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php on line 92

Warning: Undefined array key "3_2" in /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php on line 95

Fatal error: Uncaught InvalidArgumentException: target should be an object with map method or an array in /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:143 Stack trace: #0 [internal function]: WPMLFPFns::{closure:WPMLFPFns::init():141}(Object(Closure), NULL) #1 /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #2 [internal function]: WPMLFPFns::{closure:{closure:WPMLFPcurryN():136}:137}(Object(Closure), NULL) #3 /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array(Object(Closure), Array) #4 /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php(104): WPMLFPFns::__callStatic('map', Array) #5 [internal function]: WPMLFPLst::{closure:WPMLFPLst::init():103}('label', NULL) #6 /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array) #7 [internal function]: {closure:{closure:WPMLFPcurryN():136}:137}(NULL) #8 /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(50): call_user_func_array(Object(Closure), Array) #9 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php(278): {closure:WPMLFPcompose():47}(NULL) #10 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php(225): WPMLFormsHooksWpFormsNotifications->getChoiceMap(NULL, Array) #11 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php(95): WPMLFormsHooksWpFormsNotifications->getFieldValue(Array, 'TxC5x99etxC3xAD moxC5xBEnos...', NULL, Array) #12 /home/html/maverick-transport.cz/public_html/wp-includes/class-wp-hook.php(324): WPMLFormsHooksWpFormsNotifications->restoreFieldLabelsToDefaultLanguage(Array, Array, Array) #13 /home/html/maverick-transport.cz/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #14 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpforms/includes/class-process.php(1650): apply_filters('wpforms_entry_e...', Array, Array, Array) #15 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpforms/includes/class-process.php(638): WPForms_Process->entry_email(Array, Array, Array, 37, 'entry') #16 /home/html/maverick-transport.cz/public_html/wp-content/plugins/wpforms/includes/class-process.php(156): WPForms_Process->process(Array) #17 /home/html/maverick-transport.cz/public_html/wp-includes/class-wp-hook.php(324): WPForms_Process->listen(Object(WP)) #18 /home/html/maverick-transport.cz/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #19 /home/html/maverick-transport.cz/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #20 /home/html/maverick-transport.cz/public_html/wp-includes/class-wp.php(830): do_action_ref_array('wp', Array) #21 /home/html/maverick-transport.cz/public_html/wp-includes/functions.php(1336): WP->main('') #22 /home/html/maverick-transport.cz/public_html/wp-blog-header.php(16): wp() #23 /home/html/maverick-transport.cz/public_html/index.php(17): require('/home/html/mave...') #24 {main} thrown in /home/html/maverick-transport.cz/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php on line 143

Symptoms:

Questions:
How to fix this issue? 🙂 Thank you 😉

March 4, 2025 at 10:57 am #16773245

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Here is the ticket. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

March 4, 2025 at 2:09 pm #16774549

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I'm logged in to your Website and could you please list the steps to replicate the issue? Also, please include some screenshots of the issue.

I've tested the form on the homepage and it works fine.

March 4, 2025 at 2:17 pm #16774596

dominikN-6

Hello Kor,

the bug happens when you try to submit the form using WPForms Repeater.
So just fill all the inputs, add new block of inputs by pressing "přidat vůz" on left side and then try to submit.
Getting this issue on both Goggle Chrome and Mozilla Firefox.

Thank you.

bug-screenshot-1.png
March 4, 2025 at 2:21 pm #16774629

dominikN-6

FYI - This bug disappears when "WPForms Multilingual" plug-in is deactivated.

March 5, 2025 at 1:27 am #16776400

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

I can see the issue now. Please allow me to investigate this further and I will come back to you as quickly as possible.

March 5, 2025 at 8:02 am #16776848

dominikN-6

Yes, sure, go for it. Let me know if you find anything. Also which plug-in cause this issue. Thank you.

March 5, 2025 at 4:17 pm #16779846

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I'm able to replicate this issue on our sandbox site here and I will escalate this further to our 2nd Tier Support for further investigation. I will come back to you once I've feedback.

Sandbox site : hidden link

Test page : hidden link

Error : https://pastebin.com/D4vZbWLM

March 5, 2025 at 4:39 pm #16779978

dominikN-6

Hi Kor, thank you for update. Do you have any idea when we can expect any feedback? Is there anything we can do on our end? Thanks.

March 5, 2025 at 7:00 pm #16780388

Serkan

Hey in case it helps:
I've managed to solve the issue the following way:
```
public function restoreFieldLabelsToDefaultLanguage( $fields, $entry, $formData ) {

$formPost = wpforms()->get( 'form' )->get(
$formData['id'],
[ 'content_only' => true ]
);

$formPostFields = $formPost['fields'];
$translatedFields = $formData['fields'];

foreach ( $fields as $key => &$field ) {
$realKey = $key;
if(strpos($key, '_') !== false) {
$realKey = explode("_", $key);
$realKey = $realKey[0];
}

$field['name'] = $formPostFields[ $realKey ]['label'];
$entryFields = Obj::propOr( [], 'fields', $entry );
if ( array_key_exists( $key, $entryFields ) ) {
$field['value'] = $this->getFieldValue( $field, $entry['fields'][ $key ], $formPostFields[ $realKey ], $translatedFields[ $key ] );
}
}

return $fields;
}
```
Not sure if this is the most correct/best solution but it worked for me. Hope this helps.

March 5, 2025 at 8:54 pm #16780611

dominikN-6

Hey Serkan and Kor, should I try to add this to functions.php?
Is this like an official fix or should I keep waiting any further update? Thank you and have a great evening.

March 5, 2025 at 9:43 pm #16780679

dominikN-6

Also FYI I've tested the Sandbox form and there is the bug still.

March 6, 2025 at 3:25 am #16780938

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. Our 2nd Tier Support is still checking on this and I will come back to you once I've feedback.