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 21 replies, has 2 voices.

Last updated by Yvette 1 year, 8 months ago.

Assigned support staff: Yvette.

Author Posts
October 1, 2019 at 11:59 am

Kristof

I have reported this issue already in the Toolset forum, but it is still not resolved and we believe this might be more of a WPML issue.
Original topic: https://toolset.com/forums/topic/the-uploaded-images-to-the-original-post-are-different-from-the-translated-post/
Continued topic: https://toolset.com/forums/topic/continued-the-uploaded-images-to-the-original-post-are-different-from-the/

We are able to recreate this issue on multiple occasions with these steps:
- Switch to Dutch language in top bar
- Accommodation > Add New > fill in required fields
- Scroll down to Image Gallery > Select images (for ex first 10) > Save Draft
- Translate this Document > Duplicate English and French (do not check Duplicate Media attachments)
- Edit the English translation > confirm Edit independently > Complete translation > Save and close
- Switch to English language via top bar
>> You will see the first uploaded image repeated 10 times (or more if you selected more image in the previous step) even if you refresh the page (important for next step).
- Preview the translation
>> You will see the first uploaded image repeated 10 times AND the rest of the uploaded images 1x.
- Go back to the post edit and refresh the page again.
>> Now you will also see the first uploaded image repeated 10 times AND the rest of the uploaded images 1x.

October 2, 2019 at 11:21 am #4679647

Yvette
Supporter

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

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

Hello

I will be helping you with this and repeating the steps as you have described them to confirm the behaviour you describe.

1. Clarification
You wrote: "...do not check Duplicate Media attachment..:"

For translated images, I would have expected that you WOULD duplicate the mediat attachments. Is there a particular reason why you have insisted to not have this setting?

2. Diagnostic
Have you confirmed that the same behaviour occurs if you temporarily change your active theme to Twenty Seventeen and also temporarily deactivate you non-WPML plugins? e.g. only Toolset and WPML plugins with a WordPress standard theme configuration

Thanks for your answers.

October 3, 2019 at 12:53 pm #4687825

Kristof

Hi Yvette,

1. The images will be the same in all languages, therefore I saw no need in duplicating them for every language. If specifically added this info, so you would be able to reproduce my flow to the t.

2. I can confirm that I can reproduce this issue with the TwentyNineteen theme and activated plugins: HBook (to create a property), Toolset Types, Toolset Views, WPML, WPML String Translation and WPML Translation Management.

Only difference is that because of the absence of the Avada Theme (and the Child functions.php) the shortcode [repeating-images-gallery] does not render the gallery so I cannot visually confirm the issue on the frontend, however it is visible in the editor.

The shortcode is:

add_shortcode('repeating-images-gallery', 'repeating_images_gallery_func');
function repeating_images_gallery_func($atts, $content) {
    global $post, $wpdb;
      
    $images = get_post_meta($post->ID, 'wpcf-image-gallery', false);
    $ids = array();
    foreach ($images as $image) {
        $attachment_id = $wpdb->get_var($wpdb->prepare(
            "SELECT ID FROM $wpdb->posts WHERE guid = %s",
        $image
        ));
        $ids[] = $attachment_id;
    }
    $out = do_shortcode('[fusion_gallery image_ids="' . implode(",", $ids) . '" columns="4" column_spacing="20" lightbox="yes"]');
    return $out;
}
Screenshot_17.jpg
October 3, 2019 at 1:48 pm #4688231

Yvette
Supporter

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

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

Thank you.

Another question. Is the shortcode : [repeating-images-gallery] a custom shortcode or one that is deliered with Avada?

IN any case, I understand that the issue is still visible when editing the post type and no frontend rendering is necessary to confirm the repeating images.

Thanks for the clarification nevertheless.

October 3, 2019 at 3:13 pm #4689349

Kristof

A custom shortcode but it indeed includes an Avada shortcode to output the gallery.
I will check if the Avada shortcode is still used this way as Avada is regularly updated.

October 3, 2019 at 3:42 pm #4689523

Yvette
Supporter

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

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

That would be very helpful indeed. thank you.

If it is still a "valid" shortcode from Avada, could you kindly attempt to reproduce a simplified example of this issue on this sandbox site here:
hidden link

You should upload the Avada theme and your custom shortcode then create a very simple example with only this shortcode appearing.

We can then isolate and troubleshoot the issue much faster.
Thanks

October 3, 2019 at 4:35 pm #4689867

Kristof

OK, but creating a simple example would also require to install and configure the Hbook plugin and the Toolset custom type with all its custom fields.

October 3, 2019 at 5:36 pm #4690353

Yvette
Supporter

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

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

I realise this - but you know you can export/import the Toolset custom post type so that will be very quick.

I am not sure what Hbook plugin does. Why is this needed?

October 3, 2019 at 5:46 pm #4690477

Kristof

Oh, I did not know I could export that. I'll try.
HBook is a booking plugin, without it, there is no CPT "Accommodation" and no Image Gallery to link to.

October 3, 2019 at 5:59 pm #4690565

Kristof

How can I import my WPML settings into the sandbox?

October 3, 2019 at 6:31 pm #4690787

Kristof

- I have installed Avada and Avada Child (with the shortcode in the functions.php) and imported Avada Options from the existing site.
- I have installed Toolset Types and Toolset Views and imported both the Types settings and View settings from the existing site.
- WPML plugins were already installed on the sandbox. But I really need to be able to import the settings from the existing site to create an exact copy.
- However, I have done a test with an English accommodation, uploaded about 10 images, created a duplicate for the Spanish language and I notice the same issue, see screenshot.

Screenshot_18.jpg
October 3, 2019 at 6:44 pm #4690863

Yvette
Supporter

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

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

Perfect. I really appreciate this effort. I will be able to debug this more simple case and call in the appropriate resources now if needed.

I will update you as soon as I have some news or further quesitons.

October 4, 2019 at 3:15 pm #4696847

Yvette
Supporter

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

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

Hello

I see that you are using a View to create the image gallery for a accomodation and that this is part of a content template assigned to the Accomodation post type,

1. Could you please setup another Accomodation example for me to test with? Maybe 2.

2. I was able to translate the following accomodation successfully without repeating images by doing the following:
- Duplicate the post
- Swtich languaage
- Translate the post independently and then save.

See here:
hidden link
hidden link

How were you creating the translated Accommodations?

October 7, 2019 at 10:49 am #4706357

Kristof

1/ can you answer:
WPML plugins were already installed on the sandbox. But I really need to be able to import the settings from the existing site to create an exact copy.

2/If it is still a "valid" shortcode from Avada
I can confirm that our shortcode in functions.php still uses the correct Avada shortcode config

3/ How were you creating the translated Accommodations?
I explained this step by step in the initial question, are you asking for something different now? Please explain.
In short it would be
- Duplicate the post
- Translate the post independently and then save.
- Switch language
I can still reproduce this issue that way, see screenshot.
If I follow your 3 steps, after duplication and switching to the other language, that translation is empty and there is no "Translate the post independently" question.

Screenshot_19.jpg
October 7, 2019 at 1:39 pm #4707871

Yvette
Supporter

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

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

Hello

I believe I understand what is happening....but I´m not sure how to "fix" it.

It appears that your image gallery uses the same field name for each gallery image (see image). " wpcf-image-gallery"

In a similar situation with repeating fields and the plugin ACF, repeated fields are enumerated such as " wpcf-image-gallery_01, wpcf-image-gallery_02, ...."

In the duplication process, the custom fields are duplicated, but the first value is assigned.

I need to now try to separate the issue of the custom field from the Toolset bit. Would you please create a regular post that only uses this [repeating-images-gallery] shortcode?

Then, when you duplciate/translate independently this normal post type, does the same problem happen?
Thanks for your assistance on this

SameCustomFieldAlwaysUsed.png