I’m working on a project on several computers, so I keep ACF fields in the
acf-json dir and commit it to the repo. When ACF fields are changed then a “sync” options appears in the ACF admin panel… usually.
Today I’ve noticed a strange thing. ACF json file got modified. I’ve seen a modified file in the
acf-json dir but the sync option wasn’t available. The newly added fields were visible on the post edit pages, but on the “Edit field group” screens I’ve seen the old data.
I tried to modify the timestamp (the “modified”) field in the *.json file manually, I hoped that it will force ACF to “see” the file was modified, but it didn’t help.
Finally, I made a backup of the
acf-json directory, removed the directory, removed all fields groups from the admin panel, restored the
acf-json directory – and then the
sync option appeared and I was able to synchronise the fields.
I’m afraid I can’t tell what caused the problem, and I cannot reproduce it. Tell me what else can I provide you with in order to make it easier to find what caused that strange behaviour, because it’s definitely a bug.
I’m facing the same issue. I have a modified acf-json file but not “sync available” button appears on the interface.
I did what you did and it worked! thanks
Same problem here. Updating Local JSON files, and even the “modified” value, doesn’t result in the fields group being ‘available for sync’. Is it a bug or I’m missing some step?
Is there a way to manually trigger the function that checks if there’s available syncs?
There is only one thing that I can thing of that would cause this to happen and that is that the timestamp in the JSON file is less than the last modified date (GMT) of the acf-field-group post. This could happen if someone edited/updated the field group later then what the timestamp in the JSON file is.
My bad. I made it work. Was changing the modified date but apparently had some error there. Generated a new one and it worked.
Has anyone else made progress on this? I’ve tried the solutions in this thread but….no luck.
Thought I’d add a little extra to this ticket for anyone else in the future. I use the JSON options on a ton of sites and run into the usual permission issue on the odd occasion but on one site my std install (a seperate file with acf filters and hooks) stopped syncing.
The file was loading correctly which is called into the theme on the functions page and loads
add_filter( 'acf/settings/save_json', array( $this, '_acf_json_save_point' ) ); add_filter( 'acf/settings/load_json', array( $this, '_acf_json_load_point' ) );
But for some reason while my class was loading these filters were not firing. Turns out there was a line above including my file that was using get_field an ACF function. Because this ran the filters did not load.
So in my case this would not work (BAD EXAMPLE)
define( 'MAIN_SITE_URL', get_field( 'main_site_url', 'option' ) ); //* ACF Hooks and Filters include_once( get_stylesheet_directory() . '/lib/AcfExt.php' );
where the acf function was called before the rest of the filters. All it took to fix was changing the order and the hooks fired again as expected
//* ACF Hooks and Filters include_once( get_stylesheet_directory() . '/lib/AcfExt.php' ); define( 'MAIN_SITE_URL', get_field( 'main_site_url', 'option' ) );
Hope this helps anyone else who has a random sync not showing up error
+1 same issue here, we are getting conflicts in GitHub because the json file is not syncing correctly (Does not show as available to sync even if you change the Field Group).
Same issue. Deleted the acf-json folder and the fields in the admin panel and then re-added the folder and sync became available.
I ended up here googling for this same issue, but have found an easier solution:
Edit the json for the group to have modified = the current timestamp, refresh the admin, and the group will be listed in the sync available list to sync.
I have the same issue: sync is not working, not showing – unreliable.
Found that – export/import works!
Fortunately – it does rewrite (update) exiting FG’s.
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!
👷♀️👷♂️ Our reputation was built on a UI focused field form builder, but we won't take offence if you rather define your fields via PHP or JSON.— Advanced Custom Fields (@wp_acf) May 31, 2021
The Local JSON feature in ACF increases performance and team productivity! ⚡️https://t.co/c7xSQ22tAR
❤️ 7 of 10 pic.twitter.com/3viaNfhE6s
© 2021 Advanced Custom Fields. Subscribe