Support

Account

Home Forums General Issues ACF doesn't save data on first save

Solving

ACF doesn't save data on first save

  • Hello dear ACF users,

    I’m having an issue with ACF (WP 5.8.1 and ACF 5.10.2).

    I’ve created a bunch of field groups. However, when I try to create a post using one of the field group, the datas contained in the custom fields are not saved when I try to publish or save to draft.
    I have to reopen the saved post. All the fields are blank at new, and it works finally on the second attempt.

    I only have ACF as plugin, and I tries with the default WP themes, and the issue is still here.

    Thanks in advance for your help.

    Kind regards

  • One more detail : the MySQL version is 15.1

  • I came here to report the exact same issue! Everything was fine until recently. Perhaps the last WordPress update broke something? I am using the same versions as you.

    Everything appears to be sending correctly and the response looks correct on the initial save, but the data is not saved.

    /wp-admin/admin-ajax.php?_fs_blog_admin=true

    Request

    acf[field_5fc3aad04255a]: 10
    acf[field_5fc7261aae126]: 2021
    action: acf/validate_save_post
    nonce: e31d46a48c
    post_id: 4987

    Response

    {“success”:true,”data”:{“valid”:1,”errors”:0}}

    The update sends the exact same data to the exact same endpoint and gets the exact same response, but it works.

  • Hello roodoggy,

    Thank you for your answer. I checked the pcap dumped, and I have the same behaviour than you

  • So I also checked the database. The datas from ACF are not saved on the wp_postmeta table on the first publishing.

  • Hello,
    Did someone else encounter the same issue ? I’m pretty sure that we are not the only one.

  • OK here are more information to help for the debugging.

    From what I can see on network capture, the ACF datas aren’t sent to the server at the first post save, except for the fields validation.

    So basically, the network activity that I see when I push the publish button is something like:

    Client :
    -POST /wp-admin/admin-ajax.php …. action=acf/validate_save_post (the ACF fields are here)
    Server :
    -Ok valid, success
    Client :
    -POST /index.php/wp-json/wp/v2/posts/<id>?_locale=user (in data, there are the post title, categories, status, but no ACF fields…)
    Server :
    -OK, post created
    Client :
    POST /wp-admin/admin-ajax.php action=acf/ajax/check_screen
    Server :
    -Some informations

    And that’s all. In this configuration, the ACF data are never sent to the server, except for the validation. So it can be a beginning of the investigation here.

  • Was there any update to this ticket? I am having similar issues with my project. I am unable to write to my DB when updating an ACF field and clicking ‘Save Draft’

  • @cvolpe12 No update yet. Currently, I enter all my data except for the advanced custom fields. Then I hit Save Draft, F5, then enter the custom fields data, and finally publish.

    It’s a bit annoying but only takes an extra second.

  • Hello, I was able to find a workaround on my side. I found out that it was happening only on fields that weren’t directly drawn on page loading (e.g, fields that only appear if some conditions are matched).

    So I choosed to draw by default all fields, and filter them after when the user select his options/categories, etc. This is not perfect but it works

  • I also have fields that don’t save the first time. I use them in custom fields with a taxonomy condition. Is there any update on this?
    The acf fields for another custom post type – without conditions – do save at first save.
    But my ACF image-field in the taxonomy categorie don’t show also not on a Xth save – no conditions apply here.

  • At further trials – I think it is not so much a first save that fails – but I need to hit Ctrl Shift R / F5 to load the ACF fields properly after saving the condition (a category in this case).

  • also -it wasn’t a problem in my local install (wamp) ?

  • I cannot reproduce this error so there isn’t much I can do to help figure out why it’s happening.

    Has anyone tried contacting the develeoper or submitting a ticket?

  • I have the same issue, but with only the Relation field
    It happening when I add a new post via relation field

  • I have the same issue and trying to find working solution here

  • Group fields are not saving why ?

  • I only have ACF as plugin, and I tries with the default WP themes, and the issue is still here.

  • Hi All,
    I got same issue with ACF Pro and contacted the support.
    The support guy said they recognized this issue and trying to fix with the next major version up.

    At now, only I can do is saving draft before writing anything in ACF fields, and hit F5 reload, then write in ACF fields.

  • So I have this problem, yet oddly enough only on one single website. I use the same host for all my sites. No errors show up. If there would be a workaround this would be great, assuming the problem is indeed known.
    Edit: I did update to 6.0.1 and the problem persists, so the mayor update didn’t solve it for me.

  • Update (in case anyone is still around for this): this still happens on the latest version, but NOT when the condition is, for example, “post type is equal to post”, but it does when the condition is category or taxonomy. I hope someone has a fix for this.

  • Excellent find, timternet! That should definitely help debugging. If they are really looking into it. This is so annoying I may have to go through the source and fix the bug myself.

  • Regarding this bug, one UI improvement I would highly suggest is to have the “Save Changes” button go into a different state after you click it. Whether it say “Saving…” or “Submitting…”, anything would be better than for the button to keep the same text as before I pushed it. There have been a couple of times already where I’ve gone away from the page because the button state stays the same, and it completely jumbles up the order of blocks when using Flexible Content.

  • I created multipul sites from the last year but this issue is still there on all sites I created.

  • after the upadate on April 2023, this issue might be solved.
    Idk it was solved on 6.1.1 or 6.1.3, but at least checking my 3 sites with 6.0.3, it worked finely.

Viewing 25 posts - 1 through 25 (of 27 total)

You must be logged in to reply to this topic.