Skip to content Skip to sidebar

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

2 Responses to “WPForms - Incorrect Field Labels and Email Notification Issue with Repeater Fields”

  1. Hello,

    I changed the code, but this still happens.

    Any other troubleshooting steps I should try?

    Thank you. Best.

    • Hello there
      Thanks for getting in touch. If the current workaround isn’t resolving the issue, could you please open a new ticket on our support forum? We’d be happy to help further.