Hi guys,
Does anyone have a clue about this?
Thanks
Hi guys,
Does anyone have a clue about this?
Thanks
Hi guys,
Does anyone have a clue about this?
Thanks
Hi @hube2 – do i understand correctly that if the groups don’t exist in DB there is not need to trigger sync or try to implement autosync for that matter and things will work correctly?
If so, can you advice how should i clean up the DB on my existing staging/prod envs so that this works as expected?
Is reading from json instead of DB more optimal?
Thanks
Hi John,
This doesn’t work for me either.
The flow we are using is as follows:
1. Devs do local changes and push the json files to a repo.
2. The changes get automatically deployed to a dev and at some point at prod env.
3. When the wp admin gets refreshed, the changes are suppose to be auto sync’ed to the given environment.
The acf groups do get update, however many of them are showing multiple times in the Field Groups page. The acf fields are showing just fine in e new post/page, however i’m not sure if multiplication of groups would cause issues or not, but it doesn’t look nice.
I saw that there were other topics in the forum regarding this same problem, so there must be some clean solution.
Thanks, for trying to help.
@hube2 The plugin does exactly this – it checks if the group doesn’t exist and then imports it. However if the group json file is huge and due to it’s async nature, the function is called few times and this leads to duplicates.
So you are saying that if it is done only on theme activation it would be fine?
Hi John,
Yes, I tried this implementation and with few changes it works. However for huge field groups (many flex content components) which sync for 5-10 seconds which causes duplications of the group (it appears two or more times). This is due to the async nature of the implementation. The hook gets triggered few times before completion of the fist triggered sync:
public function maybe_update_field_groups_from_json( $json_dir )
Any idea how to deal with this?
Thanks
Hi John,
I’ve tested your advice and indeed i don’t need to sync the updates to all sites but just the main subsite. However, i’d still like to have the auto sync option as i’m looking to build automated release process to different environments, which as final step would include automatic filed group syncing. Any ideas about this?
Thanks
Hi Guys,
Does anyone have an idea?
Thanks
Hi Guys,
Does anyone have an idea?
Thanks
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.