Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
When trying to save form configuration in WPForms under settings -> notifications -> Advanced -> File Upload Fields, the selected files to upload disappear after saving.
Solution:
If you're experiencing this issue, we recommend you try the following steps:
1. Edit the

/wp-content/plugins/wpforms/src/Pro/Admin/Builder/Notifications/Advanced/Settings.php

file.
2. Look for line 205.
3. Comment out the following code:

// $output .= sprintf(<br />// '<input type="hidden" name="settings[notifications][%1$d][%2$s][hidden]" value="%3$s"/>',<br />// $notification_id,<br />// $field,<br />// esc_attr( wp_json_encode( $saved_value ) )<br />// );

After making these changes, please try to replicate the issue. This solution has been tested on a sandbox site and works as expected.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.

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: 

This topic contains 14 replies, has 2 voices.

Last updated by Osama Mersal 9 months, 3 weeks ago.

Assisted by: Osama Mersal.

Author Posts
October 4, 2024 at 10:12 am #16253246

Gertjan Ekkel

Background of the issue:
I am trying to save form configuration in WPForms under settings -> notifications -> Advanced -> File Upload Fields. After saving, the selected files to upload disappear. In the JSON in the post, I see: "file_upload_attachment_fields":{"hidden":"[6,7]"} instead of "file_upload_attachment_fields",[6,7]. This issue only occurs when WPML Multilingual is activated. After manually setting the data in the post, everything works as expected.

Symptoms:
Normal form behavior breaks after saving the configuration. The JSON in the post changes unexpectedly to: "file_upload_attachment_fields":{"hidden":"[6,7]"} after one save and "file_upload_attachment_fields":{"hidden":"["6","7"]"} after saving again.

Questions:
Why does the JSON change unexpectedly when WPML Multilingual is activated?
How can I prevent the file upload fields from disappearing after saving?

October 6, 2024 at 10:36 am #16257763

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

First of all, sorry for the late reply; it was due to a higher workload.

Please log in to this hidden link">sandbox site and try to replicate the issue.

If the issue is reproducible, please provide me with the steps to reproduce it so I can check it and consult our compatibility team if necessary.

Best regards,
Osama

October 7, 2024 at 8:50 am #16259728

Gertjan Ekkel

Hi, Thanks for setting up the sandbox environment. We need wpforms basic to reproduce the error. The [file upload] option is not available in the free version.

Kind regards Christiaan van der Schoot

October 7, 2024 at 9:28 am #16259929

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I installed the WP Forms. Please check if you can replicate the issue.

Best regards,
Osama

October 7, 2024 at 9:32 am #16259946

Gertjan Ekkel

Hi, there is no licence key. As so as i tick the [file upload] option, the plu-in response is: "To access the File Upload field, please enter your WPForms license key." Should I use our own?

October 7, 2024 at 9:34 am #16259953

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I added our testing license.

Best regards,
Osama

October 7, 2024 at 9:38 am #16259956

Gertjan Ekkel

Same error: after adding the [File Upload Fields] to the notification and I press save, after that I refresh the page and my added fields are gone.

October 7, 2024 at 10:04 am #16260201

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for replicating the issue. Would you please share a screen-recorded video while reproducing the issue?

Best regards,
Osama

October 7, 2024 at 10:12 am #16260271

Gertjan Ekkel

How can I share the screen recording. In here I can only attach an image.

October 7, 2024 at 10:14 am #16260273

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Please upload it to a file transfer service, such as Google Drive, and share the URL with me.

Best regards,
Osama

October 7, 2024 at 10:15 am #16260276

Gertjan Ekkel

hidden link

October 7, 2024 at 11:02 am #16260757

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Could you please grant me access to the file?

Best regards,

October 7, 2024 at 11:22 am #16261029

Gertjan Ekkel

Sorry, wrong account, pleas try this one:
hidden link

October 7, 2024 at 11:55 am #16261137

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for the video. I'll consult our compatibility team about this issue and update you as soon as they reply.

Best regards,
Osama

October 13, 2024 at 9:43 am #16282865

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for your patience. Please check the following steps:

1- Edit (/wp-content/plugins/wpforms/src/Pro/Admin/Builder/Notifications/Advanced/Settings.php) file.
2- Look for line 205.
3- Comment out:

// $output .= sprintf(
// 	'<input type="hidden" name="settings[notifications][%1$d][%2$s][hidden]" value="%3$s">',
// 	$notification_id,
// 	$field,
// 	esc_attr( wp_json_encode( $saved_value ) )
// );

After that, please try to replicate the issue. Applying the above steps on the sandbox site works as expected.

Please check the issue on the sandbox.

Best regards,
Osama