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: Compatibility, Known issue
This topic contains 10 replies, has 1 voice.
Last updated by andreasH-126 17 hours, 20 minutes ago.
Assisted by: Andreas W..
Author | Posts |
---|---|
September 19, 2025 at 2:29 pm #17417096 | |
andreasH-126 |
Background of the issue: Symptoms: Questions: |
September 19, 2025 at 2:32 pm #17417189 | |
andreasH-126 |
Temporary login link hidden link |
September 19, 2025 at 2:33 pm #17417193 | |
andreasH-126 |
Bug free WPForms Multilingual code for Notifications.php: <?php namespace WPML\Forms\Hooks\WpForms; use WPForms_Conditional_Logic_Fields; class Notifications extends Base { const EMAIL_HTML_CONTEXT = 'email-html'; /** Adds hooks. */ add_filter( 'wpforms_html_field_value', [ $this, 'restoreRawValuesForHtmlEmail' ], 10, 4 ); // These are only required in the 'Pro' version. /** return $value; /** return $value; /** $formPost = wpforms()->get( 'form' )->get( $formPostFields = $formPost['fields'] ?? []; foreach ( $fields as $key => &$field ) { // Resolve structures using a clone-aware helper. // Label: prefer original form-post label when available. // Value: only translate/format when we have a submitted entry field structure. return $fields; /** $email = is_array( $data['to'] ) ? reset( $data['to'] ) : $data['to']; $dataKeys = [ 'subject', 'message' ]; if ( $this->notEmpty( 'settings', $formPost ) ) { $formPost['settings'] = $package->translateFormSettings( $formPost['settings'] ); $current_notification = $formPost['settings']['notifications'][ $emails->notification_id ]; $setData = function( $data, $key ) use ( $current_notification ) { return $data; foreach ( $dataKeys as $key ) { $data = SmartTag::process( $data, $formPost, $dataKeys ); $translated = [ 'notifications' => [ $emails->notification_id => $data ] ]; return $translated['notifications'][ $emails->notification_id ]; /** /** $package = $this->newPackage( $this->getId( $formData ) ); if ( foreach ( $formData['settings']['confirmations'] as &$confirmation ) { $confirmation = SmartTag::process( $confirmation, $formData ); return $formData; /** /** /** /** switch ( $field['type'] ) { if ( is_array( $entryField ) && $choicesMap ) { case 'likert_scale': case 'payment-multiple': case 'payment-checkbox': default: /** if ( Obj::prop( 'dynamic_choices', $originalField ) ) { $getChoices = pipe( Obj::path( [ 'choices' ] ), Lst::pluck( 'label' ) ); $originalChoices = $getChoices( $originalField ); if ( ! is_array( $originalChoices ) || ! is_array( $translatedChoices ) ) { $choicesMap = []; for ( $i = 0; $i < $max; $i++ ) { return $choicesMap; /** $form_data = $this->restoreConditionalLabels( $form_data, $fields ); return $conditionalLogicFields->process_notification_conditionals( $process, $fields, $form_data, $id ); /** foreach ( $form_data['fields'] as $key => &$field ) { // Prefer exact key, else find the first clone "{$key}_N". if ( ! is_array( $submitted ) || ! isset( $submitted['value_raw'], $submitted['value'] ) ) { foreach ( $field['choices'] as &$choice ) { return $form_data; } |
September 19, 2025 at 2:51 pm #17417216 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, The numeric values are, by default, not translatable on the Advanced Translation Editor. You might need to search for these values when translating the form by using the text search field on the top right of the Advanced Translation Editor. It might even be the case that you need to use the following XML configuration at WPML > Settings > Custom XML Configuration to make the numeric values translatable: After adding this config, you will need to edit the original form, save it, then create a new translation job for the form on the WPML Translation Dashboard, translate the form, and make sure to translate these numeric values. Please give this a try and let me know if this will not work out. Best regards |
September 22, 2025 at 6:16 am #17419927 | |
andreasH-126 |
Hi, I can test this, but I have this setup on +30 sites and they have 5-10 forms on each, so doing this for about 250 forms, and teaching about 10 web editors to do it each time they create a new form, that is not feasable. Makeing a fix for the repeater fields in the WPForms Multilingual plugin seems like a more reasonable way forward. I don't want to "hack" the plugin each time there is a new official update either. |
September 23, 2025 at 6:58 am #17423580 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I understand, but could you please confirm first if my suggestion solves the issue? This is basically not a plugin hack; it is only a limitation on the Advanced Translation Editor, as it is designed to translate text only and will hide any numeric values and non-visual elements by default. Such values are usually copied over in the background and remain identical in all languages. This design is required to avoid automatic translation leading to unexpected results. |
September 24, 2025 at 8:53 am #17428080 | |
andreasH-126 |
OK, but just to be sure: This is not a translated page, this is an original page in the default language (Swedish). So no translated fields are being involved here. But when I deactivate (or "patch") WPForms Multilingual, the error disappears. Also, the numbers in the repeater fields are created dynamically in WPForms, when a user adds more fields in a form. I don't create (or translate) field 1_1, 1_2, 1_3 etc. There can be an infite number of repeater fields with an infinite number of numbers. |
September 24, 2025 at 3:03 pm #17429633 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I have created a new test site with a form incl. two repeater fields, but I can not confirm any error on form submission. Could you please test using the latest version of WPForms? If this does not solve the issue, could you please try to replicate the issue on the following test site? One-Click-Login: If you can't replicate the issue there, please allow me admin access to your site for further revision. I would like to request temporary access (wp-admin and FTP) to the website to investigate the issue further. The required fields are located below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it. IMPORTANT I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further. However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose. If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/. If you are unable to provide such a copy of the website for testing, please let me know on this ticket. The private reply form looks like this: Click "I still need assistance" the next time you reply. Video: Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form. |
September 30, 2025 at 7:04 am #17442717 | |
andreasH-126 |
OK, I'll test it and come back. |
September 30, 2025 at 7:17 am #17442818 | |
andreasH-126 |
I could replicate the bug on the first try at hidden link As a frontend user, fill in the fields and than click "Lägg till" to add at least one extra set of repeater fields. Than try to submit the form. This triggers an error that prevents the form from being sent. Deactivate WPForms Multilingual and the bug goes away. I've specified exactly what's wrong in the code and how to fix it in this ticket. |
October 1, 2025 at 3:35 pm #17449457 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
We have published an errata for the reported issue: Please take note of the following workaround for this issue: Open the file .../wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php Look for line 92 Replace: foreach ( $fields as $key => &$field ) { $field['name'] = $formPostFields[ $key ]['label']; $entryFields = Obj::propOr( [], 'fields', $entry ); if ( array_key_exists( $key, $entryFields ) ) { $field['value'] = $this->getFieldValue( $field, $entry['fields'][ $key ], $formPostFields[ $key ], $translatedFields[ $key ] ); } } With: foreach ( $fields as $key => &$field ) { $key = strpos( $key, '_' ) !== false ? substr( $key, 0, strpos( $key, '_' ) ) : $key; $field['name'] = $formPostFields[ $key ]['label']; $entryFields = Obj::propOr( [], 'fields', $entry ); if ( array_key_exists( $key, $entryFields ) ) { $field['value'] = $this->getFieldValue( $field, $entry['fields'][ $key ], $formPostFields[ $key ], $translatedFields[ $key ] ); } } Please give this a try. It solved the issue in the provided sandbox. This issue will be solved in the next update for "WP Forms Multilingual 0.5.0". |
October 9, 2025 at 6:40 am #17469507 | |
andreasH-126 |
Awesome, thanks a lot for picking this up! |