Skip Navigation

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

Problem:
You might be facing an issue where Advanced Custom Fields (ACF) are not being saved on WooCommerce product pages. This problem occurs even with the default theme, and it affects only new products, not existing ones. Additionally, the required fields validation is ignored when saving these product pages.
Solution:
We are currently working on a permanent fix for this issue. In the meantime, we recommend a temporary workaround:
1. Navigate to the

.../wp-content/plugins/advanced-custom-fields/includes/validation.php

file.
2. Locate line 135.
3. Comment out the following lines:

// // validate<br />// if ( ! acf_verify_ajax() ) {<br />//  die();<br />// }

Please ensure to test this on a staging environment to avoid potential side-effects.
For updates on the permanent fix, you can monitor the related errata here: Advanced Custom Fields conflicts with field validation on AJAX requests.

If this solution does not resolve your issue, or if it seems outdated or irrelevant 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 needed, please open a new support ticket at WPML support forum for further assistance.

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 9 replies, has 2 voices.

Last updated by Dražen 10 months, 4 weeks ago.

Assisted by: Dražen.

Author Posts
July 19, 2024 at 8:50 am

mariusl-3

Background of the issue:
I have a strange bug. Even with the default theme I cannot save any of Woo product ACF fields. The ACF fields are saved on regular posts, but not on products. Also, I can edit previously posted products' ACF fields, but when I create a new one, I get this problem.

Symptoms:
It saves the post and just ignores required fields validation, saves the post and ignores ACF fields content by not saving it at all.

Questions:
Why are ACF fields not being saved on Woo product pages?
Why is required fields validation being ignored when saving Woo product pages?
Why can I edit ACF fields on previously posted products but not on new ones?

July 19, 2024 at 9:44 am
July 20, 2024 at 7:03 am #15980984

mariusl-3

I've just checked everything one more time. I've just left ACF and WPML plugins as active and set to default theme aswell for testing.

I've find out that at least the photo type field never validating/saves on add new page/post. i'm using the latest ACF Pro version (6.3.4) and the latest WPML version (4.6.12). If i'm downgrading ACF PRO to the version before (6.3.1.2) the photo validates and saves. If i'm deactivating the WPML plugin - the validation works fine and the fields are saved, so this is definetely a problem with incompatability between WPML and ACF on your side.

This is a critical bug as it's impossible to save data with the latest versions of both plugins and the user can skip required fields, so the frontend breaks.

Could you investigate it asap?

July 22, 2024 at 6:19 am #15984836

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Thanks for getting back to us and sharing additional info. This has been escalated to our compatibility team, and I will update you soon on any news and workarounds.

Regards,
Drazen

July 22, 2024 at 6:22 am #15984868

mariusl-3

Ok, let me know! As I need to continue with the project - please DO NOT edit anything on my website. If you need - I will be able to provide you with other staging logins with this problem, but this bug is not related to my environment, so I guess you can replicate it with latest versions as I did. Let me know, as its super urgent to solve it.

July 22, 2024 at 6:37 am #15984908

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

sure, as for ETA I can not guarantee anything but it will take a few days for sure. I will update you as soon as I have some news.

Regards,
Drazen

July 22, 2024 at 6:46 am #15985000

mariusl-3

All right. Let me know and if you'll need anything from me - I will provide anything you need. J

July 24, 2024 at 6:13 am
July 24, 2024 at 8:32 am #15996945

mariusl-3

All right. Could you please let me know once the permanent fix will be available to download?

July 24, 2024 at 9:31 am #15997201

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

sure, I will let you know, but please note this will take a while before we have a new ACFML version with permanent fix to be released.

Regards,
Drazen

August 5, 2024 at 10:52 am #16039196

mariusl-3

Any news?

August 7, 2024 at 7:26 am #16046360

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I am afraid a permanent fix will not be soon, in the meantime you can use the workaround shared above. When the new version is released with the fix I will update you, or you can monitor next errata:

- https://wpml.org/errata/advanced-custom-fields-conflicts-with-field-validation-on-ajax-requests/

Regards,
Drazen