Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

This topic contains 5 replies, has 3 voices.

Last updated by Bigul 1 year, 3 months ago.

Assisted by: Bigul.

Author Posts
January 8, 2024 at 5:30 pm #15162228

ryanS-16

Hello,

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.

Thanks,
-Lee

Screenshot 2024-01-08 at 11.29.01 AM.png
Screenshot 2024-01-08 at 11.27.01 AM.png
Screenshot 2024-01-08 at 11.27.17 AM.png
Screenshot 2024-01-08 at 11.27.23 AM.png
January 9, 2024 at 4:31 am #15162969

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello Ryan,

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.

If you want to expedite the process and receive the update immediately, follow these steps:
1. Go to the Plugins → Add New page.
2. Click on the Commercial tab.
3. Then, click the "Check for updates" button.
https://wpml.org/wp-content/uploads/2020/04/wpml-force-plugin-update-1.png

Please remember to create a backup before updating, as a precaution.

Look forward to your reply.

Thanks

January 12, 2024 at 3:48 pm #15180023

ryanS-16

Hello,

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.

-Lee

Screenshot 2024-01-12 at 9.46.15 AM.png
Screenshot 2024-01-12 at 9.47.25 AM.png
Screenshot 2024-01-12 at 9.47.32 AM.png
January 13, 2024 at 8:09 am #15181108

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Lee,

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

--
Thanks!

Bigul

January 17, 2024 at 4:11 pm #15195937

ryanS-16

Hi Bigul,

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.

-Lee

Screenshot 2024-01-17 at 10.08.28 AM.png
Screenshot 2024-01-17 at 10.08.40 AM.png
January 18, 2024 at 7:21 am #15198184

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hi Lee,

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.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

The topic ‘[Closed] WPML GraphQL – ACF Post Object field doesn't return translated items’ is closed to new replies.