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.

This topic contains 23 replies, has 2 voices.

Last updated by Bruno Kos 2 months, 2 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
July 24, 2019 at 1:15 pm #4274829

ivanG-15

I am trying to:
show all translated products with images

Link to a page where the issue can be seen:
hidden link

I expected to see:
all images

Instead, I got:
only a few of them

July 24, 2019 at 1:31 pm #4275189

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML support!

May I ask you to upgrade WPML and all its addons to the latest versions? I see that you're having WPML Multilingual CMS 4.2.5, while the latest versions can be seen here:
https://wpml.org/account/downloads/

As for the issue, can you tell me if the issue is present on original products or their translations? If on translations, can you open originals and simply click update? If that doesn't work, can you try the following:

https://wpml.org/documentation/getting-started-guide/media-translation/#media-translation-settings
-> click apply while everything is checked, especially "duplicate featured images for translations"
-> try going to WooCommerce -> WooCommerce multilingual -> status -> troubleshooting -> Sync products "gallery images": (in case this is happening with gather images as well, and not only featured image is for products)

Regards,
Bruno Kos

July 24, 2019 at 1:45 pm #4275271

ivanG-15

Hi Bruno,

Thank you for your assistance.
I see no WPML upgrades on the Plugins page. Do I need to upgrade it manually?

The issue is present on some translations only.

Unfortunately, Click Update didn't help ๐Ÿ™

I've already tried to check all "media-translation-settings" and pressed Start button, without luck ๐Ÿ™ And Sync products "gallery images" with the same result ๐Ÿ™

Thank you.

July 25, 2019 at 5:42 am #4279209

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I see no WPML upgrades on the Plugins page. Do I need to upgrade it manually?

Try deactivating the site key for WPML and registering again. If not, then do it through FTP by removing the original plugins and installing them anew. You will not close any translations or configuration options.

As for the issue, can you try the following then? Open any of the broken originals and change the language in the dashboard admin bar and then try to set the featured image for the translation.

Does it work?

Regards,
Bruno Kos

July 25, 2019 at 9:09 am #4281169

ivanG-15

Bruno,

I've already updated all wpml plugins.
I've added an image to translation and it works but I have hundreds of broken products ๐Ÿ™
Is there any way to reassign it automatically? Thank you.

July 25, 2019 at 9:16 am #4281237

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Can I ask the following:
- when you're saying that they disappeared after an upgrade, what kind of upgrade are referring to? WooCommerce, WPML, WordPress or something else? Do know from which version to which version?
- do you have a backup of the site before this occurred perhaps? In the form of duplicator maybe?

Regards,
Bruno Kos

July 25, 2019 at 9:35 am #4281377

ivanG-15

To be honest I do not remember when this happened. I noticed it by accident. I have backups, but not sure which of them without issue ๐Ÿ™

July 25, 2019 at 9:42 am #4281467

ivanG-15

And I noticed a strange thing when I try to search an image by name I found an original image and few empty copies, some of them with the same file path even :\

July 25, 2019 at 9:46 am #4281553

ivanG-15

I guess this empty phantom copy assigned to translation and wpml see no issues and can't fix it ๐Ÿ™ I have no idea how these copies were created ๐Ÿ™ Did you see a similar issue before? Thank you.

July 25, 2019 at 9:50 am #4281609

ivanG-15

I have "Enable Media Replace" plugin installed, I disabled it temporarily. It didn't help but maybe this is a source of the issue?

July 25, 2019 at 10:08 am #4281675

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

I have asked our 2nd tier support to check this thread and also discussed this in our internal supporter forum. It looks like that something has gone wrong sometime in the past, possibly during some of the upgrades or before that. Also, it looks like that all images belong to the same language, so that we may have various issues and not related to images specifically. This is also why none of the troubleshooting function works ( as you also pointed out - it seems that there is an image of fact), not even updating the original product which should set a a featured image on translation.

It also looks like that there are missing thumbnails, so these may have been deleted at some point in the past or the values and database pointing to them also got corrupted. Was is directly deleted or was a language deactivated at some point... It is hard to tell.

We feel like it would take much longer to try to troubleshoot and check what is behind this, than to do that unfortunate manual job of setting these images on translations in the way I described before.

I also suggest that you try restoring some of the backups on the localhost or maybe on staging server if you have one and then check if the issue was there also. And then try upgrading everything to see what happens. But then again, it will be difficult to move all the orders that happened since and possibly many of the customers who registered on the site, so that brings new problems on its own.

Let me know your thoughts!

Regards,
Bruno Kos

July 25, 2019 at 11:10 am #4282245

ivanG-15

I did some investigation, maybe it helps you. The media (_thumbnail_id) in wp_posts table stored in the correct version as a direct link to the image - "hidden link" but in the products with the issue the image stored as a link on a page - "hidden link" There is no this page on our site - 404 I don't know what exactly must be stored in the guid field - direct link or attachment_id page. Maybe your developers know? If attachment_id is possible, so I'll try to redirect it to the image. Yoast SEO plugin has to redirect it to the image, but it doesn't ๐Ÿ™

July 25, 2019 at 12:46 pm #4283171

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

Here is the thing - I think that this is the information we will find interesting:
- the information about the image attachment we will find within wp_postmeta will not benefit us in any way, as far as I'm concerned
- the field will find interesting is, as you said, _thumbnail_id, which contains the ID of the image - either the original or the "duplicate" (duplicate only in database) WPML has created
- WooCommerce should, based on this value, take required values and sizes stored within wp_postmeta (such as featured images or various thumbnail sizes)
- when it comes to the way how products and their translations are connected, this information is stored within wp_icl_translations table, and they are grouped by the "trid" value - if this value is the same, as you can see my image, this means that you're looking at original and it's translations, where the element_id are post_id values
- for example, in my case (thumbnail-id image), I have the product with ID 142, for which the image ID is 147. If I leave this value empty or I changed to the ID of the image which isn't there (in database), nothing shows up on the product front end

Now, ideally if all three elements from the same TRID group have the same _thumbnail_id, it should work and featured image should be visible on the front end. However, it would take a complex SQL query that would copy the _thumbnail_id values within the wp_postmeta, based on post_id and only for post_ids that belong to the same TRID group from the wp_icl_translation table.

If I'm not wrong, a query like this (if possible) one might fix all of your thumbnails on the site at once.

Regards,
Bruno Kos

July 25, 2019 at 3:30 pm #4284681

ivanG-15

Thank you for the information. My products from the same "trid" group have a different thumbnail-id image. And if I change image manually in admin area, nothing changed ๐Ÿ™ I can't see any changes ๐Ÿ™ Too strange... The best way now is to change it manually, but I try to find a source of this issue :\

This is a link to a product with id=956\9730 and screenshots attached.Thank you.

hidden link

July 26, 2019 at 5:59 am #4287641

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

And if I change image manually in admin area, nothing changed

How did you get those images working them? I see the featured image showing up in both products.

Regards,
Bruno Kos

The topic ‘[Closed] Some Woocommerce Product Images disappeared after upgrade’ is closed to new replies.