This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing a 500 Internal Server Error when using WPForms, WPML, and WPForms multilang with a Repeater containing Select form elements, the issue might be related to how array keys are handled in the Notifications.php file of the WPML-WPForms integration.
Solution:
We recommend modifying the code in the Notifications.php file. First, locate line 92 and replace the existing code block:
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 ensure to test this change on a staging site before applying it to your live environment.
If this solution does not resolve your issue, or if it seems outdated or irrelevant to your specific case, we highly recommend opening a new support ticket. Also, check the related known issues and confirm that you have installed the latest versions of themes and plugins.
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.