Open Sandstedt opened 2 years ago
Just gonna note that adding fields to non-flexible content fields seems to work. Just added fields to an options page with a plain hierarchy, and that worked just fine. Will try to investigate a bit more. But a bit hard when I don't know how everything is connected among pages and meta data.
I am having a similar issue. I am not using Flexible fields.
@danimalweb We ended up exporting the fields to a JSON file, deleted the ACF declarations, changed the root id to another random id in the JSON file, and then imported it again. Then it "just worked". But a cumbersome workaround. So will leave this open. But the example URL's in this issue will now work correctly, so have removed them.
I think I am experiencing the same issue, though mine is with a custom field group that was added to users.
Whilst the values on these fields appears to be persisted (from some business logic when a user registers), none of the values make it into the JSON response until I go in and edit them manually (or re-save the account) from within WP Admin.
I've included two screenshots, one which shows how many lines present in the JSON response before re-saving the account (175 lines) and the second one after saving (178 lines).
Strangely, in the ACF group, one of the fields does come through every time - it only seems to be a recently added fields that are not appearing. Also other ACF groups work perfectly all the time.
I would love to help track down this issue and work on a fix - as it is really affecting the operation of my site (as I need to go in and re-save every new user!)
Hi @airesvsg Any idea about this - it's causing me huge issues with using this plugin as some fields are missing on the API, even though there are values set on the user object!
Was doing some further investigation today... It seems that all ACF fields are being returned if I use the WooCommerce API
... e.g. https://DOMAIN/wp-json/wc/v3/customers/600
is correctly displaying the field within the meta_data
section of the response.
For some weird reason (not sure if it's related to this great plug-in, or some server setup), suddenly (it did work before) new changes in ACF (adding new fields) doesn't show up in the JSON output.
So ex: I have a flexible content array with some components inside (acf_fc_layout). When I add a new component there with some fields in, the only thing showing up in the REST API JSON response is
acf_fc_Layout: "name_of_component"
. No other fields are visible.But on older components that has many key value pairs already, I can change the content and the value will update. So it's not a cache issue with the entire JSON file. And everything looks perfectly fine in wp-admin, and I think it looks correct in the DB as well. But a bit hard to know.
So seems to be something wrong between the DB and ACF to REST API plug-in and how that returns the JSON response.
Any idea how to debug or finding the root cause of this weird issue?
Ex response: (replace [slash] with / in url:s, just making it hard for bots here on github :D) /wp-json/preview/v1/1419 -> acf -> fields[2]. Here there should be a
isBookingZone: true
, that is visible and working in both WordPress and the database, but it is not showing up here in the response. But changing title returns correct value.Also attaching the ACF setup for this
category_grid_artists
component