Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem: If i don't use a translation editor and i want to have different flexible field elements per language, some of them erase their content

Solution: set the translation preference of all the fields inside the flexible field to either "translate" or "copy once".
They all MUST have the same exact translation preference (included the flexible field itself).

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

Last updated by Alejandro 3 years, 10 months ago.

Assisted by: Alejandro.

Author Posts
December 11, 2020 at 10:09 pm #7647659

Adam

I am trying to: update some ACF fields of an English translation of an originally Spanish page.

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

I expected to see: the updated fields

Instead, I got: all of the ACF data wiped out

To further clarify, the site itself has "English" as the main language and Spanish as a secondary language, though in this page's particular case, the original page was in Spanish first, then translated to English. When I edit a Spanish translation of another originally English page, this issue does not occur.

Also, this issue only appeared after updating to 4.4.7 (4.4.8 does not fix it). When I rolled back to 4.4.3, the problem went away.

December 14, 2020 at 1:18 pm #7660627

Alejandro
WPML Supporter since 02/2018

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

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

Hello,

1) I couldn't recreate the problem on a local installation. would you be able to recreate the problem from scratch on a sandbox site and send me the steps you took? maybe i'm missing something.

Here's the link of a sandbox site that you can use: hidden link

What you'd need to do:
- Create a staging site (we can create one for you if you can't do it on your own)
- Install WPML (4.4.8) + its latest ACFML + Translation Management and String Translation versions as seen here: https://wpml.org/account/downloads/
- Add the languages of your site

Then write the steps you took to have the content disappearing as in your site..

2) In the meantime, i kindly ask you to run the folowing troubleshooting options since you changed your default site language:

Go to WPML -> Support -> Troubleshooting
Press the following buttons:
• "Clear the cache in WPML"
• "Remove ghost entries from the translation tables"
• "Fix element_type collation"
• "Set language information"
• "Fix post type assignment for translations"

Then try to see if with the latest versions, the problem keeps happening

December 14, 2020 at 6:20 pm #7662981

Adam

Hi Alejandro,

The troubleshooting options didn't seem to fix the issue.

I also wasn't able to replicate the problem on the sandbox site, but I wonder if there's an issue with legacy data vs a brand new install. On the marcahuasi site, I've turned off all plugins except for ACF & WPML, and a default theme turned on, but the problem persists. If you're able, I would really appreciate you taking a look -- I've setup an administrator account for you:

u: wpml
p: hidden link

The page where you can see the ACF fields at the bottom not saving correctly: hidden link

Thank you!

December 15, 2020 at 10:32 pm #7672979

Adam

Thanks, Alejandro! The migration is done, and the problematic page is here: hidden link

You'll see the issue with the fields not saving if you enter text into any of the blank spaces in the "Building Blocks" section (at the bottom of the editor), hit update, and then refresh the page.

Let me know if you need anything else from me.

December 17, 2020 at 9:50 am #7683971

Alejandro
WPML Supporter since 02/2018

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

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

The main issue is that ACF Multilingual was disabled.

i enabled it and saw that you had yet to configure it. you can use this guide to configure it: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

In a nutshell:
- Content that you want to translate should be set to "translate" (by "translate" i mean change the value between the translations).

- Content that you want to NOT change the value but always keep the same value throughout the translations should be set to "copy"

- Layout fields should also be set to "copy".

Try that, then make a change to the title or body of the page that has issues with your ACF and then try to translate it again.

That should fix the problem you're having 🙂

December 17, 2020 at 10:38 pm #7689093

Adam

I think I set it up as suggested -- I set the "Layouts" flexible content field to "copy", but the "Title Text" and "Text" fields to "translate". (hidden link)

I just tried creating a new block on that same page, but it's not actually saved when I refresh the page: hidden link

December 18, 2020 at 9:12 am #7691341

Alejandro
WPML Supporter since 02/2018

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

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

I see, ok i'm almost certain the problem here is the same as this known issue: https://wpml.org/errata/acf-flexible-fields-not-syncing-correctly-with-different-layouts/

I'd suggest you enable the Advanced Translation Editor while we fix this issue. the reason why i suggest this is because of the nature of the problem.

The problem is caused because you have layouts and when you add new ones, and maybe try to shuffle them, they end up being "moved" so the content loses its initial position and the translations are lost because they are assigned to something that doesn't exist anymore.

With the Advanced Translation Editor, the content is picked up from the original but the position here won't be a problem since it will just pick up the content and then apply the translation memory and it will always be added in the correct place because it's linked to the content and not the position (which is a parameter of the classic editor instead).

That way you'll always have your own content translated.

Could that work for you?

December 18, 2020 at 9:42 pm #7697201

Adam

Gotcha, thanks for the explanation! We've rolled back to an older version of WPML, and we're fine staying on that until a fix gets rolled out.

December 19, 2020 at 2:29 pm #7699931

Alejandro
WPML Supporter since 02/2018

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

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

Thanks for letting me know. i'll change the status of the ticket so i can let you know when the fix is released.

Regards and have a nice weekend.

July 31, 2021 at 2:09 pm #9320493

Alejandro
WPML Supporter since 02/2018

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

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

Hello,

Turns out that after a few changes we tried and after a few updates from ACF, we can't really do much here, because of many restrictions from both our internal logic and ACF's.

We tried to fix a few things in our code to improve a specific workflow that could accomodate this scenario

All you need to do now is set every single field inside the flexible field to "copy-once" (including the flexible field itself) or "translate" so it would work.

Afterwards add a character to the original page, save it and then translate it.

That is the only way we can make this scenario work.