Support

Account

Home Forums Bug Reports "Sync" option not available

Solving

"Sync" option not available

  • 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?

    Cheers!

  • 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.

    Thanks!

  • 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

    (WORKING EXAMPLE)

    
    //* 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.

    Thanks

  • 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.

  • Same issue here: sync is not working, not showing

    No matter if I use default path in theme or choose a path in plugin!?

  • To anyone still running into the same issue as the OP, something to try…

    But first: my issue was that I was doing some search and replace on the JSON file in order to save time and bulk modify text strings, etc. At the end of this, I would change the modified value and would find that SYNC wasn’t available…

    So, what helped me, which boils down to double check your modified value versus the file’s:

    • The issue for me was I didn’t note that the server timestamp was actually ahead of my local time (for whatever reason), so when I added a modified value that was current to my local time, it was still behind. In such a case, ACF won’t notice that the file has changed.
    • The easiest way to determine if this is your issue is to save the Field Group from the WP admin. Then note the modified value (remember that timestamps are “seconds since JAN 01 1970 UTC”). If your own timestamp is less than this value, then you need to increment from the saved file’s number.
    • Hope that helps someone!

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘"Sync" option not available’ is closed to new replies.