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.
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.
The update sends the exact same data to the exact same endpoint and gets the exact same response, but it works.
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:
-POST /wp-admin/admin-ajax.php …. action=acf/validate_save_post (the ACF fields are here)
-Ok valid, success
-POST /index.php/wp-json/wp/v2/posts/<id>?_locale=user (in data, there are the post title, categories, status, but no ACF fields…)
-OK, post created
POST /wp-admin/admin-ajax.php action=acf/ajax/check_screen
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.
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.
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.
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.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!