I am trying to sunc field group. All groups are properly getting synced except the group having flexible content type. If flexible content exist then it throws 504 gateway timeout.
I did some research on it but did not get something valuable. Ultimately increasing execution time and all or disable revision is not a proper solution.
There is a file ‘acf-field-functions.php’ of path: advanced-custom-fields-pro/includes/acf-field-functions.php has a function ‘acf_update_field’ which is used to update field while syncing data. By removing the apply filters from that function resolves the issue. Also screenshot attached for the same.
$field = apply_filters( ‘acf/update_field’, $field );
Any help on this will be highly appreciated.
I’m guessing you have a lot of layouts with a lot of fields and it’s causing the db queries to time out the sync.
you cannot remove that filter, acf uses that filter for specific types of fields, including flex fields.
My question would be why are you syncing the field groups? I am assuming here that you have a site that you edit on (staging) and a live site. If this is the case, and you never edit the field groups on the live site and only sync them then there is no reason to sync them from the json files on the live site. In fact, these fields should only exist in the acf-json folder in the theme and not in the database.
If you do edit them on the live site then you’re going to need to find a way to reduce the number of fields in the field group. I would do this by using clone fields. I would create an empty field group for each layout and then I would “MOVE” the fields from each layout into it’s own group and finally I would clone that group back into the layout.
Thanks for your quick response!
Yes, I am using lots of layouts on a single flexible content group that is what causing issue.
I have 3 different env. like local, stage and prod. In my stage site sometime it is needed to edit the field group for that when i started syncing the group then it throws timeout error.
Surely, i will try to use this clone alternate solution to do this job but ultimately the problem is still there when we go through normal sync process.
After the timeout, is the field group actually synced?
Just because the web browser times out does not mean that the server has stopped processing the request. As long as you have a sufficient PHP time limit the full request should be processed.
After syncing and the time out inspect the field group, compare it to the other environment.
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!
© 2023 Advanced Custom Fields.