Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is using English (EN) as the main language and Bahasa Malaysia (MS) as the secondary language on their website. They have an Advanced Custom Fields (ACF) gallery image on a custom post type (CPT) that displays correctly in English. However, in the Bahasa Malaysia translation, the image IDs are not retrieved, and no images are displayed, even though other text custom fields are shown correctly.
Solution:
We found out that the issue was caused when the "Duplicate existing media for translated content" in Settings > Media is unchecked. After enabling this setting, the images are showing up correctly again.
If the problem persists, it might be due to an outdated solution or a different cause. We highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue is still unresolved, please open a new support ticket with us.

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.

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 2 months ago.

Assisted by: Osama Mersal.

Author Posts
March 17, 2024 at 11:32 am #15418266

eugeneTeo

On my website, I'm using English (EN) as the main language and Bahasa Malaysia (MS) as the secondary.

#2. On a CPT, I have a ACF gallery image. I can get all the images ID correctly in the EN language in the single post, but in the MS language, I get no images. However, all other text custom fields can be shown correctly.

March 17, 2024 at 11:41 am #15418274

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Would you please elaborate more on the issue to help me understand it better?

It would be very helpful if you could share screenshots or a screen-recorded video while reproducing the issue.

Best regards,
Osama

March 21, 2024 at 1:21 am #15434095

eugeneTeo

On my website, English (EN) is the primary language and Bahasa Malaysia (MS) is the secondary. I disabled media translation as I want the images to be shared across all languages.

I have a custom post type called "Theatre" as an example. The WPML translation settings that I used for this CPT is "Translatable but use translation if available or fallback".

In Theatre, there's a ACF gallery field. When I add in images into the gallery field for a Theatre post , the gallery shows up correctly in the primary language (Example: hidden link). But when the same post is in the secondary language (Example: hidden link), ONLY the gallery images doesn't show up at all. All other content for the post shows up correctly.

P/S: If I share live links here, can they be set to private?

March 21, 2024 at 11:07 am #15435795

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for your update. I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

March 27, 2024 at 3:40 pm #15456903

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for the access details. I don't see any translated Theater posts. Please translate this post to reproduce the issue. (hidden link)

Best regards,
Osama

March 27, 2024 at 3:51 pm #15456980

eugeneTeo

There are no Theater posts that are translated to secondary at the moment (the client will handle that) but it needs to have a fallback so that other texts, such as the labels or headings, are using the secondary language.

See the MS version hidden link

P/S: Please mark the links as private

March 27, 2024 at 4:02 pm #15457075

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Please edit the translated single template using "Bricks" and check if it works correctly. (hidden link)

I think this issue happens because of the builder. Please add this gallery using the code and check if it will work correctly in both languages.

Best regards,
Osama

March 27, 2024 at 4:05 pm #15457097

eugeneTeo

I've tried using sample code directly from ACF's website for the gallery field, but it still doesn't show up on the MS page. The EN still works fine with the same code.

March 27, 2024 at 5:04 pm #15457498

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I created a sandbox site and added a simple code to show the gallery, and it works correctly in both languages. Kindly check the following posts:

1) EN: hidden link

2) MS: hidden link

Please login to this sandbox site and install your Bricks. (hidden link)

After that, please create a similar single template and translate it to replicate the issue.

If the issue is replicable, please let me know to consult our compatibility team.

Best regards,
Osama

March 27, 2024 at 6:33 pm #15457869

eugeneTeo

The gallery seems to work in the sandbox site. I'll try to dig up further on why this is so.

Also something I just recalled about the site is that the client had previously installed the Media translation, but I had it deactivated. Will that have any impact of whether the image loads correctly?

March 27, 2024 at 9:12 pm #15458074

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

1) The sandbox site doesn't have Media Translation installed, so I don't think it's the cause of the issue.

2) Following these steps, Please check if the issue persists in a minimal environment.

1- Deactivate all the plugins except those active ones on the sandbox site.
2- Switch to your parent theme.
3- Create a new test template and translate it.
4- Compare the theme and WPML settings on both sites.

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Best regards,
Osama

April 3, 2024 at 7:19 pm #15480186

eugeneTeo

I've found out that the issue was caused when the "Duplicate existing media for translated content" in Settings > Media is unchecked. After enabling this setting, the images is showing up correctly again. "Duplicate" wording here is pretty misleading and probably should be reworded IMO.