WPML
Status
Resolved
Reported for
WPForms Multilingual 0.4.1
Resolved in
WPForms Multilingual 0.5.0
Topic tags
Compatibility

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

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 ] );
        }
    }
            

All known issues →