I am having issues with WPML GraphQL not returning data on translated posts when using the ACF Post Object field.
I have created a component and used the ACF Post Object field in a repeater and on it's own. This component is then cloned into an ACF Flex Content field that is used on pages. When I query this field in GraphQL with the WPML GraphQL and ACF GraphQL fields enabled, the post object only returns items in the default locale of English. When a translation in French is selected using the Post Object field, it returns an empty array in GraphQL.
In the screenshots, you can see I've added posts to the Post Object fields and the GraphQL query is returning empty for any of the translated content. If a post is not translated, it will show however return the data for some reason.
Welcome to WPML support. I'd be happy to help you with this.
You mentioned the field is added inside repeater fields, can you create a test field that is a standalone field and doesn't have a repeater or flexible fields as a parent and see if it works?
Further, We've recently rolled out a new version of WPML plugins. Could you please update your plugins to the latest version and inform me if it resolves the issue?
Our WPML updates are distributed gradually. If your websites haven't received this update yet, please be patient, and you should see it within a few days.
I tried a Post Object field outside of a repeater and flex content field. When querying a Page in an alternate language, the Post Object still returns an empty array, even when Posts have been selected.
If I look in the translations schema in GraphQL, the post object field will also return an empty array. The Post Object field only returns the values for the default language page. I'd expect the Post Object field to return the values I've selected on the French translated page instead of being empty.
I am Bigul from the WPML support team. Shekhar is on vacation. So I am taking care of this ticket and hope it will be okay for you.
Thank you for the details. Hope you have upgrade to the latest version of WPML(4.6.9 series) before doing these tests.
Please tries the following troubleshooting steps after a full site backup{mandatory} and make sure the issue is existing or not.
1) Go to WPML>>Support page, click on the Troubleshooting link (blue link in the middle of the page)
2) On the Troubleshooting page, please click on the following options of the *Clean up* section. Wait for confirmation of processing after each one.
- Clear the cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Set language information
- Fix WPML tables collation
- Assign translation status to duplicated content
- Fix terms count
- Fix post type assignment
Unfortunately these steps didn't resolve the issue with the Post Object ACF field not returning translated posts. It still provides and empty array item when the post is translated and returns the English post if it's not translated.
This seems like a bug in the WPML GraphQL plugin.
Attached is a screenshot showing the query to the `home-fr` French translation and the `home` (English) default translation.
Thank you for the details. A couple of requests for tracking this issue. It may be a compatibility conflict.
1) Please let us know the exact steps to reproduce the bug on your site. It would be great if you could share a screencast for a better understanding. It will help us in our internal communication.
2) Please fill the private details fields after a full site backup{mandatory}. I would like to access the admin area of your site for further checking. Refer to the following links for more details about our private information sharing policies.
The topic ‘[Closed] WPML GraphQL – ACF Post Object field doesn't return translated items’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.