Overview of the Issue
When using WPForms with WPML and the WPForms Multilingual addon, forms containing repeater fields display incorrect field labels (e.g., “Field ID #6_2”) in the notification email instead of the correct field names. Additionally, if a dropdown field is inside that repeater, it triggers an error, preventing the notifications from being sent.
Workaround
This issue is fixed in WPForms Multilingual 0.5.0. Updating solves it on your site, so you only need this workaround if you can’t update yet.
Please, make sure of having a full site backup of your site before proceeding.
- Open the …/wp-content/plugins/wpml-wpforms/classes/Hooks/WpForms/Notifications.php file.
- Look for line .
- 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 ] ); } }
Still Seeing This Issue?
If updating doesn’t fix it, ask a support question and we’ll look into it with you.
Ask a support question