Support

Account

Home Forums Backend Issues (wp-admin) Tab and Message fields lost on sync

Solved

Tab and Message fields lost on sync

  • We work with multiple team members, so syncing the latest ACF JSON exports is a common practice for us. Recently we are finding that when using the “Local JSON sync” tool, all Tabs and Messages are not imported.

    We’re using WP 5.8, and have tried updating ACF to 5.10.2, but this does not seem to address the issue.

    We have noticed that the saved JSON files do not have values for the ‘name’ parameter – if we add values for these, then they import correctly.

    Another test was to create a new field group with this latest ACF update: a Tab and a Message field. We then went to the JSON, made a simple field title change and date so we could sync, but again – the sync failed to import these fields.

    Naturally, re-saving ACF fields via the interface will clear any named value we manually add, meaning we need to audit for each and every local sync if we want to import those fields again. (Which of course we do)

    Does this mean that there’s something screwy with the importer? We’d prefer not to have to pre-audit each file before import if we don’t have to.

  • I just did a test syncing a field group from one site to another with a tab and message field in them and there was no issue.

    Have you tried deactivating other plugins?
    Have you tried a different theme?

    My guess is that you have a filter of some type that is causing the issue. There are too many possible filters to list them all.

  • Thanks John.

    Testing with another theme shows that this is certainly specific to the current one. Digging deeper I can see that the fields are being imported into the database, but any Tab or Message field is set to “Draft”.

    I took a look at the ACF Import scripts; and don’t see any obvious filter that I should be checking the theme scripts for conflicts against. You say there are too many to mention – can you suggest some of the more obvious ones?

  • That is odd and not something I expected. Going to be honest, I do not know what filter or action hook this could be happening on. I would look at any filters or actions that might be changing the post status, could be any filter or action that happens when a post is added or updated.

    Does this happen when adding a field through sync or also when updating an existing field? This could narrow it down if it’s only happening when adding a new field.

  • Thanks @hube2
    We did manage to identify the issue. An editorial request was to make the Excerpt field mandatory, which was causing issues with the acf-field post_type saves via the wp_insert_post_data filter. Once we located that and put an exclusion there for this post_type regular service resumed.
    It was definitely a weird one, and I appreciate the advice. Originally I had checked all save_post filters, it was a colleague who found it in the end.

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

You must be logged in to reply to this topic.