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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Kyiv (GMT+03:00)

This topic contains 10 replies, has 2 voices.

Last updated by piaP-6 21 hours, 45 minutes ago.

Assisted by: Andrey.

Author Posts
October 10, 2024 at 12:26 pm #16274958

piaP-6

Background of the issue:
I am trying to fix an issue with images on the product translations on my site, hidden link. The problem occurs with the product images on the translated version of the site, e.g. at hidden link. The src value in the img tag is simply incorrect (should be hidden link as in the Danish version). I have tried using the 'Start' option in Settings-->Media Translations and have also tried removing and re-adding the image on both the original and translated products.

Symptoms:
The product's translation has an incorrect src value in the img tag, resulting in a missing featured image on the translated page.
The problem seems to occur when it is an image that was resized (scaled) on upload by WordPress due to a big image size.

Questions:
How can I correct the images for the translated products?

October 10, 2024 at 6:56 pm #16276720

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

You are probably encountering one of the known issues below.

https://wpml.org/errata/wrong-url-on-translated-media-files-when-using-a-different-domain-per-language/

https://wpml.org/errata/wpml-media-translation-scaled-attachments-not-being-removed-correctly/

There are workarounds available to test. Please remember to backup your database before you proceed.

October 11, 2024 at 11:08 am #16279061

piaP-6

I am about to make an extra full site backup.

It sounds like the 2nd link is covering my symptoms rather than the first one. However, as I understand the code, it is only handling future image uploads. Can you confirm that?

October 11, 2024 at 3:04 pm #16280309

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Yes, you are right. If there is still an issue, please let me know. To test the problem, I recommend temporarily deactivating all the plugins except WPML and WooCommerce.

October 14, 2024 at 7:31 am #16284229

piaP-6

Hi there,

I have tried both links, and it does not fix the issue and bring back the images.

WPML outputs: hidden link

But it should be: hidden link

Ad mentioned, it works fine in the original language.

October 14, 2024 at 8:48 am #16284546

piaP-6

And temporarily deactivating all the plugins except WPML and WooCommerce did not change anything either.

October 14, 2024 at 7:32 pm #16287647

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your additional feedback.

Could you assist me in replicating the issue? It appears to be easy to reproduce. I have made the following private message and included a link to the staging site.

October 15, 2024 at 5:13 am #16288434

piaP-6

Hi Andrey,

I have tried to reproduce the issue. However, that did not succeed.

Actually, as far as I remember, the problem started after I regenerated thumbnails in CLI (https://developer.wordpress.org/cli/commands/media/regenerate/). It appears to me that WPML is picking an image, that does not exist on the translated products. However, on the original products, there are no issues.

October 15, 2024 at 2:34 pm #16291449

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thanks for your feedback.

It's possible that some database entries were corrupted after you performed that action. For instance, it could be a problem if the database entry _wp_attached_file of the wp_postmeta is blank or missing.

Are you experiencing the issue when uploading a new image? I don't think you mentioned this.

October 17, 2024 at 10:48 am #16299601

piaP-6

Nope it's not.

However, the issue is for hundreds of images - both product featured images and others.

I have created a debugging site if relevant.

October 17, 2024 at 1:12 pm #16300334

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I can check to see if there is another workaround. If not, I'm afraid I am helpless because of corrupted database entries, and you will probably need someone to fix them unless you reupload the broken images.

I need to request temporary access (wp-admin and FTP) to your site—preferably to a test site where the problem has been replicated if possible—in order to be of better help. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.