This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
hi there
i'd like to show you something on a staging site. those are the credentials: blogvault / 9f73817e.
the website is English in default and has german and french as translations. we use acf to create relationships between different post types. take this as an example: hidden link. this person is connected to news posts, programs, events and much more. all those fields are set to "copy" in ACF & WPML. however, in the translations, e. g. hidden link, most of the content is missing, even though all the connected posts are translated.
I'm trying to find out what's going on there to achieve the same result in all languages.
I enabled the debug mode, created a new people post (hidden link) and disabled all other plugins. The issue still persists. You can download the debug log here: hidden link. I also added the error log from the server.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+01:00)
Hello!
I have a quick question here. i see that you are testing the content on a new CPT that i suspect you creating using ACF, correct?
If that's the case, would it be possible to test the same on a page or post (A default cpt) to see if it works there? i'm saying this because we are working on improving the compatibility with custom post types created by ACF, and i would like to make sure the problem only happens if you are using such scenario, so i can then bring this to the attention of our devs and hopefully find you a solution 🙂
Try it out and let me know how it goes or even how are you setting it up, so i can also try to recreate it on my end.
Yes, this is purely made within ACF (both creating the post types as well as the custom fields). I'll set up a different relationship we can test with the default posts.
If this helps: one of our developers checked the database (I think it was the post meta table) and mentioned that he sees a lot of content loaded in the relationship field of a translated post. I'm not sure about this but as far as I understood, instead of just loading the ID of the connected post, it seems to load much more. This might cause the loop to not work in translations. Maybe your developers can have a look at that.
It's not working with the default posts either: hidden link.
What's important to know: we select the related posts by matching the ID. You can see the setup when you open the page in the backend (hidden link) and open the post cards element and scroll down to "Custom Field - Value Comparison" and "Custom Field - Value". Maybe WPML isn't doing it that way in the translations and thus there are no results returned.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+01:00)
you mention that: " we select the related posts by matching the ID."
May i know more about this? are you doing it via code? because the ID's will change in the translated version so if you don't use our hooks, then you'll probably end up without a proper match, thus and empty result. something like this might help there: https://wpml.org/wpml-hook/wpml_object_id/
However, more info on this would definitely help. about the metadata info, instead, i'll ask our devs what should be the correct output there because i believe that just an ID or an array of ID is not what's supposed to appear there (but i'm not an ACF expert at that level, so i'm not 100% sure of it).
When you open a translation in the default editor (what you usually shouldn't do to not interfere with the advanced translation editor), you see that all the related posts appear correctly in the corresponding acf interface. Thus I assume it's working correctly and I don't quite understand why it would work in the backend but not in the frontend.
However, I'll forward that object_id topic to our devs.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+01:00)
Opening it in the back-end is ok for any language, what you shouldn't do is change it.
If it appears ok in the back-end but not in the front-end, then chances are the problem is in the code, something is not being retrieved correctly in the code.
Would it be possible for you to indicate where is the code for this part of the site located? i may have a better idea of what to do after having inspected it.
The topic ‘[Closed] ACF relationship fields Sync issues’ is closed to new replies.