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.

This topic contains 30 replies, has 3 voices.

Last updated by Alejandro 4 years, 8 months ago.

Assisted by: Alejandro.

Author Posts
June 21, 2019 at 5:39 am #4064745

markusB-49

Hi there,
The page has been replicated again. Same instructions than above.
1. Used this product: hidden link
2. I used three sample images.
3. In the product overview (main menu link PRODUCTS) the images, pulled from each products media images, only the German version shows the image.
4. The ENG version does not show as the product page does not have the media images.
5. That is the main problem: when updated WPML only images for the German products are shown in each single product page, but not in the ENG/FRA/ESP version hence the images can't be used for the product overview page.
Does that all make sense?
Can you take it from here?
Thx
Cai

Screenshot 2019-06-21 at 7.34.50 AM.png
Screenshot 2019-06-21 at 7.34.17 AM.png
June 21, 2019 at 9:20 am #4065709

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

I'm sorry for the delay in the answer.

It seems you migrated your entire site into the sandbox which basically nulled the point of the test so i tried to replicate the problem myself by following your directions.

I basically imported your theme, PODS plugin and created 3 products with a few images each.

the problem is that i couldn't really see it as you do so there's a step i'm missing.

Could you please access this sandbox: hidden link

and in there try to replicate the problem?

Please do not migrate anything from your site (i need to have a database and site as clean as possible, to avoid conflict issues and to be faster when running the tests), the basic structure seems to be there already, so you only need to make sure that it's properly configured as in your site so i can at least see the products in the front-end as you did.

Then i'll continue the tests.

Let me know when you do.

June 21, 2019 at 3:02 pm #4067909

markusB-49

I am not sure if I understand you correctly.
In the new sandbox the same problem seems to be apparent for the product "breitbandabsorber a100 – EN — Entwurf"
1. The GERMAN version shows two images: doggies 1 and doggies 2.
2. When I switch to the other language (in the sample I used ENG and FRA), there is no image in the gallery.
3. Before I updated the WPML plugin all gallery images where the same in all languages.
4. After the update the images are in the GERMAN version only.
5. Since you did not replicate the main menu I can't show you the product overview like in my comment before.

All we need to achieve is that the gallery images in the GERMAN version per product show in all other languages on the product page, too (see screenshot). The alternative option would be to redo this all manually, which I'd obviously like to avoid.

Does this all make sense? Can we Skype?
Thanks,
Cai

Screenshot 2019-06-21 at 4.58.52 PM.png
Screenshot 2019-06-21 at 4.58.21 PM.png
Screenshot 2019-06-21 at 4.57.51 PM.png
June 21, 2019 at 3:27 pm #4068039

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

You're right. It looks like a compatibility issue, i see that all the other fields are copied without issues except the ones from the gallery, so i'll ask our developer about this and let you know.

June 21, 2019 at 3:45 pm #4068185

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

I'm escalating this ticket to our compatibility team, they'll contact the PODS author and try to find a way to fix it.

I'll keep you updated (you don't have to answer this message)

Regards.

June 21, 2019 at 7:42 pm #4069035

markusB-49

Thanks so much. This is haunting us since weeks.

June 24, 2019 at 3:30 pm #4078333

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Hello,

So, as we feared it seems to be a compatibility issue but our developers gave us a workaround.

Please try to add the following filter in the code of the template where you show the galleries:

apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code )

Most specifically, this code should go where the gallery ID is retrieved (i can only guess it's a PODS code that handles that)

Remember to change the parameters above with the correct ones.

You can use this documentation as a guide if you want to have more details on this filter: https://wpml.org/wpml-hook/wpml_object_id/

Let me know how it goes.

June 28, 2019 at 3:36 pm #4108995

markusB-49

O.k., I assuem that's good news.

For the product page I assume I have located the code snippet (see screenshots).

Just to not confuse anything where and how with what parameters do you want me to insert the line:

1
apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code )

Thanks,
Cai

Screenshot 2019-06-28 at 5.33.28 PM.png
Screenshot 2019-06-28 at 5.32.47 PM.png
June 28, 2019 at 3:45 pm #4109279

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

Can you tell me the name of the template and where to locate it, so i can send it to our developers? (i'm talking the one you show in Screenshot 2019-06-28 at 5.33.28 PM.png )

Thanks.

June 28, 2019 at 5:33 pm #4109697

markusB-49

I actually can't as the website was programmed before my time and the template name is hidden. If you ask your developer to access the sandbox he can access the template. Is not possible?

July 1, 2019 at 2:48 pm #4120447

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

May i know how did you find that code (the one from the screenshots)
I might start from there and try to discover where that file's coming from.

July 5, 2019 at 1:06 pm #4151477
normundsL

Hi guys!

I've found you conversation as I have same issue. I have several Pods custom post types. I purchased WPML and configured all custom fields as instructed in WPML documentation. But when I create new translation for post with custom image field (e.g. Person with Photo), photo is not copied, even after saving new translation (despite that it shows message at the top that a list of 'Copy' behaviour fields will be populated after saving). I have set custom field 'photo' to 'Copy' behaviour.

I tried also Copy from original language option, but image fields (also relationship and actually other pods custom fields) are not copied. I've spent many hours now to find the solution but this conversation is the closest I could get - a compatibility issue.

So is the only thing we can do is rely on Pods team to solve this? Or WPML team can do anything about this? Is there perhaps some workaround for admin UI so my client don't have to attach same image for each translation?

New threads created by Alejandro and linked to this one are listed below:

https://wpml.org/forums/topic/split-images-from-media-gallery-not-showing-in-all-languages/

July 7, 2019 at 9:36 am #4157441

markusB-49

I find it here but did not check other pages:
Projekt-Detailseite Seiten-Template (projekt-detail.php)

July 7, 2019 at 9:39 am #4157443

markusB-49

@normundsl
Thanks for you comment. I'd also appreciate if WPML can solve this asap. This is bugging me and my customer for weeks now and a fast solution would be appreciated considering we pay for the plugin-in and it obviously does not seem to be an error caused in our side.

July 8, 2019 at 9:47 am #4160665

Alejandro
Supporter

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Rome (GMT+01:00)

@markusb-49

I believe the code should be added in the loop you created (line 75 of the produkt-details.php)

apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code )

In there you have to replace the different parameters with the real ones, so "$element_id" would be either the ID or the function that returns the element ID. In your case you're using an array and i asked the developer how could this be added in there (but if you know how to proceed, go ahead)

"$element_type" would be the element type ("attachment", in your case)

in "$return_original_if_missing" you could set "TRUE"

for "$ulanguage_code" you could use this hook to dynamically get the current language:
https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/#hook-605535

Regards.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.