Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed ACF Relationship fields still showing IDs from parent site #1288

Open
tim-plimsoll opened this issue Nov 20, 2024 · 1 comment
Open
Milestone

Comments

@tim-plimsoll
Copy link

Describe the bug

I have a custom post type with a matching ACF field group on both the source and target Wordpress installations. When I pull a post to the target site, the relationship field appears empty in the UI, but if I open the database and look at the field values, I can see it has data, but the IDs are the ones from the parent site. It would be preferable if the plugin would check to see if the IDs in an ACF relationship field reference posts that have also been distributed, and change those IDs before committing them to the database.

Steps to Reproduce

  • Install ACF and Distributor on two Wordpress sites, Site A and Site B.
  • Configure Site B to be able to pull posts from Site A
  • Create an ACF field group for posts on Site A, and a relationship field for posts in that field group.
  • Export this ACF field group from Site A and import it to Site B.
  • Create a Test Post A and a Test Post B, with the relationship field for Test Post B pointing to Test Post A.
  • Create Test Post C, Test Post D, and Test Post E on Site B, to ensure the next available ID is different.
  • Pull Test Post A from Site A to Site B
  • Pull Test Post B from Site A to Site B
  • You will see the relationship field on Test Post B either referencing the wrong post, or empty.
@jeffpaul jeffpaul added this to the 2.2.0 milestone Nov 20, 2024
@tim-plimsoll
Copy link
Author

My specific use case involves both ACF Relationship fields pointing at posts that have already been distributed to the target site, and ACF Relationship fields pointing at media library items attached to the same post I am trying to distribute (to be used as a gallery on that page). I mention this because Distributor would need to keep track of the distributed media library item IDs as well, and ensure that mapping exists before correcting the ACF Relationship field on the post that just brought over all the new attachments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Incoming
Development

No branches or pull requests

2 participants