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

Last updated by Yvette 4 months, 3 weeks ago.

Assigned support staff: Yvette.

Author Posts
May 21, 2019 at 10:33 am #3854343

scottC-8

I am trying to:
Update flexible content fields within a duplicated page for each language.
I created content in the original language (au).
Duplicated it into a second language (fr).
I then switched language to FR using the top nav language select.
Created a new field in the flexible content and then moved it above another layout.
Updating the page caused the existing field below it to be emptied.

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

I expected to see:
When I add/remove/reorder layouts within flexible content, it should show the content on the frontend of the website in the updated order. This is how ACF flexible content fields work in the default language and on a none WPML site.

Instead, I got:
The duplicated page loses all content below the moved field. If the content is left below the duplicated fields, they work as expected.

May 21, 2019 at 4:26 pm #3857229

Yvette
Supporter

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

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

Hello

I am not sure I understand fully.

You wrote: "...I then switched language to FR using the top nav language select.
Created a new field in the flexible content and then moved it above another layout...."

1. So, this change was made in a SECONDARY language - correct?
2. When you made the change, I imagine that you then "translated independently" the field group. Correct?

3. Do I understand correctly that when you change the layout in the 2nd language, the layout of the frontend in the 2nd language displays the layout of the original language custom field group?

4. Can you please setup this same scenario in the following sandbox site?
hidden link

Thank you

May 22, 2019 at 9:49 am #3863921

scottC-8

Hi Yvette,

I have created an example flexible content layout and page called "Test ACF & WPML" on your sandbox environment.

1) That is correct. I created the layout first in AU and then used WPML -> Translation Management -> Translation dashboard -> selected the page -> selected duplicate content into FR. Then went to the FR version of the page to make the edit.

2) That is correct. I had the popup that said to edit anyway as it would become separate. It shows all of the ACF fields exactly the same as the original AU layout.

3) When the page is first duplicated, it is exactly the same. When I change the content in the second language it stays the same. When I drag and drop a flexible content field to change the order of the ACF flexible content rows, it breaks and removes all content below the moved field.

4) All setup for you to view and it is still occurring on the sandbox.

Steps to replicate:

I created ACF Flexible content which was set to copy once. All fields within this were set to 'translate' apart from the repeater which was set to 'copy' as per your docs.

I filled out the english content for "Test ACF & WPML" page and updated fine.

I then went to WPML -> Translation Management -> Translation dashboard -> selected the page -> selected duplicate content into ES.

I then went to the english "Test ACF & WPML" page, selected spanish in the top navigation (see screenshot attached). I then accepted the 'edit anyway' in the popup warning me that I'm editing a duplicate page. At this point, it all looks fine and the fields are bought across.

Finally, I drag and dropped the "Repeater Test" repeater field row above the "Two Third Text & One Third Image" row and clicked update. Simply changing the order of the rows. This then emptied the "Two Third Text & One Third Image" content below it.

You should be able to see the difference when looking at the english and spanish versions side by side.

May 22, 2019 at 10:24 am #3864237

Yvette
Supporter

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

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

Hi

thank you for creating the test case. Here are my observations.

1. The custom field group is not translated as expected.
2. Each custom field does not have the corresponding system field set to copy

Both of these steps are described here in this document
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#setting-the-translation-preference-for-repeater-fields

Given that you will have different layouts for each language, I would have expected you to have translated the field group.

Is there a reason why you did not elect to do this? If not, then I will try setting up the sandbox as *I* would expect to find it and then ask you to try your test again.

May 28, 2019 at 9:01 am #3904427

scottC-8

Hi,

1) Do you mean that the field group has to be translated into each language? Am I meant to click the translate or duplicate on the field group (bottom right of screenshot attached)?

2) I've now set the show field values to match the actual field groups, repeaters are 'copy' and other fields 'translate'. Now it doesn't appear to let me duplicate the page as it did before, it makes a German page but doesn't show any of the fields to edit. Also the Spanish page no longer shows any fields to edit when switching languages in the top nav bar when on the page.

There was no particular reason we did not translate the field group. We read through the docs and found the following:

"It is not necessary to translate Field Groups unless you want to translate the field labels (Field Label, Field Name, Instructions, Default Value, Placeholder Text, etc.)"

In this instance we weren't interesting in translating the labels in WordPress, just the data values, so assumed that we didn't have to translate them in this case.

It would be great if you could set up a test set of custom fields using flexible/repeaters as you would expect to see them. I can then test that to see if the issue persists.

May 28, 2019 at 9:06 am #3904565

Yvette
Supporter

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

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

Ok - I´m going to try this out on the sandbox site. I´ll let you know when I´ve completed it.

May 28, 2019 at 4:05 pm #3908771

Yvette
Supporter

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

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

Hello

So, I am not sure how to replicate the problem. I´ve duplicted/translated independently the page "Test ACF & WPML" to ES.

Can you do the test there to see if the same behavour still happens?

May 29, 2019 at 8:28 am #3913169

scottC-8

Hi,

It looks like the way that you have set the fields up has resolved the issue. Reordering the fields appears to keep the values in place.

Am I correct in thinking that you changed all of the hidden _ values (eg. _test_fields_0_right_half) to 'copy' and left the none hidden values as 'translate' or 'copy' if repeater?

Were any other settings changed to achieve this?

May 29, 2019 at 1:44 pm #3916131

Yvette
Supporter

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

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

OK - this is good news!

Here are the changes I did:

1. Duplicate and then translate independently the Field Group to ES language
2. Set the translation options for all system fields (those beginning with _ ) to "copy" and the corresponding normal custom field to "translate" . - just as you said.

If you don´t have any further questions and the issue is resolved on your normal site, you can close this ticket.