• In a shop I am working on, I created a few custom fields associated to the product post type. I have a strange issue that cannot debug further. When I publish or update the product, some of the custom fields stay empty (not updating).

    What I did for debugging:

    – Disabled all the plugins except Woocommerce and ACF
    – Changed theme to storefront
    – Disable server and website cache
    – Check server logs (nothing there)
    – Enable wp_debug and also nothing
    – Disable every custom code I had in the child theme

    What I also found:

    – The name doesn’t matter. I created a field called “Box Quantity” and I couldn’t save it. Then I delete all the custom fields and create just this one and it worked. Adding more kept this one working but not the new fields
    – Checked the database on the postmeta table and the fields values are not there. So not saved at all.

    Those are some of the server settings that might affected it. As you see, values are big enough and I even tried to increase them more with no success.

    
    PHP version	7.2.34
    PHP max input variables	6500
    PHP time limit	3600
    PHP memory limit	3072M
    Max input time	1000
    PHP post max size	260M
    

    Wordpress Version 5.8.2
    Advanced Custom Fields Version 5.11.4
    WooCommerce Version 6.0.0

Viewing 1 replies (of 1 total)
  • Thread Starter dantekavala

    (@dantekavala)

    Trying to debug further. When I click on update on the post, if I inspect the HTTP request to admin-ajax.php, the payload has this:

    acf[field_61cf02821292a]: 500
    acf[quantity-label]: 1000 items

    The first one is saved to the database, while the second doesn’t. Doing more tests, looks like all the acf that have the name field_xxxx in the payload gets the update, while the rest don’t

Viewing 1 replies (of 1 total)
  • The topic ‘Fields are randomly not saved’ is closed to new replies.