Skip to content Skip to sidebar

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

Problem:
If you're experiencing issues where field values disappear after setting a custom post type (CPT) to publish flexible content, it might be due to the translation settings of your ACF field groups.

Solution:
We recommend checking the translation settings of your ACF field groups in WPML. Specifically, ensure that the 'acf-field-group' is set to 'Not Translatable' in WPML -> Settings -> Post Types Translation. Here's a step-by-step approach to resolve the issue:
1. Delete all language translations of the field group(s).
2. Set 'acf-field-group' to not translatable.
3. Add the field group in the default language (English, in this case).
4. Test these changes on a staging/test site after taking a full backup.
Additionally, if you want to maintain the current settings, follow this workflow for adding posts:
- Add the post first in German.
- Then add the translation to another language (e.g., Slovak).
- If adding another translation (e.g., Polish), first edit the post in German, then add the translation.
Repeat these steps for other translations.
For further guidance, please check the recommended custom fields translation preferences for ACF and WPML.

If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.

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.

Tagged: 

This topic contains 11 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 6 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
October 8, 2024 at 11:29 am #16265152

sebastianV-9

Background of the issue:
I am trying to resolve an issue where field values disappear after setting a custom post type (CPT) to publish flexible content. More details can be found here: https://wpml.org/forums/topic/field-values-disappear-after-set-cpt-to-publish-flexible-content/

ticket was closed by your side aber not by my side, please reopen it. can you use another email adress to contact?

Symptoms:
Field values disappear after setting a CPT to publish flexible content.

Questions:
Why do field values disappear after setting a CPT to publish flexible content?

October 8, 2024 at 11:44 am #16265181

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Reference to our recent chat I've moved the matter to this ticket as requested.

I need to investigate the issue in more detail and escalate accordingly. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

Regards.

October 9, 2024 at 8:33 am #16268579

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access, I am working on this and 'll get back to you as soon as I find something or have a solution.

October 9, 2024 at 12:46 pm #16270268

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I tried to login to your site and after submitting the credentials, there's the following error:

> There has been a critical error on this website. Please check your site admin email inbox for instructions.

Can you please check on your side if you can login? If yes, please deactivate all plugins and switch to 2024 theme and let me know. I'll then try again and activate plugins as needed.

October 10, 2024 at 10:38 am #16274313

sebastianV-9

please try again, i has no error on login. i deactiavte query monitor and error log monitor

October 10, 2024 at 11:07 am #16274431

sebastianV-9

i deactivate solid security pro now your login works.

October 10, 2024 at 12:33 pm #16275062

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, I was able to login and I am working on this and 'll get back to you as soon as I find something or have a solution.

October 11, 2024 at 7:18 am #16277758

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I checked the issue in very much detail. However I found following a little confusing:

A. Site's default language is English, while other languages are secondary.
B. But the ACF field group was added in German first (making it field group's default lang) and then translated to other languages (considering those secondary langs for the field group).

Based on the above mentioned, I tried following scenarios and recorded my screen (download from hidden link - contains 2 recordings as below):

1. screencast-Slovak to German.webm: Shows adding post first in Slovak which has fields in secondary language as compared to German. When adding German translation, fields are not copied and some are even locked and post can not be saved (due to required locked fields).

2. screencast-German to Slovak.mp4: Shows adding post first in German (because the field group was first added in German and then translated to other langs). So when adding Slovak translation, all fields are copied (except the ones set as translate). And content is retained even after it is published.

Why this is happening? Please consider following.

This is happening because you've set "acf-field-group" to "Translatable" in WPML -> Settings -> Post Types Translation, which is not the correct way and is not recommended.

If you keep it that way the above mentioned 'll keep happening and you may also keep getting undesired results.

If you want to fix this for good, then correct workaround is:

- delete all language translations of the field group(s).
- then set "acf-field-group" to not translatable.
- add the field group in the default language (i.e. currently English is the site's default language).
- of course, test this in a staging/test site first, after taking full backup.

Otherwise, if you want to keep this as-it-is, then the correct workflow for adding posts, having these fields, is:

- add the post first in German.
- then add the translation to other language (i.e. Slovak).
- then if you want to add another translation (i.e. Polish), first open the post in German for editing.
- then add translation to other language (i.e. Polish).
- repeat the previous 2 steps for adding other translations of the post.

I've confirmed the above mentioned with my team also.

P.S.: I had to turn off "required" for Address field because Google Maps key was invalid and wasn't allowing me to save a post. You may turn it back on as necessary.

October 11, 2024 at 12:53 pm #16279740

sebastianV-9

thank you for you reply.
the site default, starting language is english right, but iam german and add all other in german first.

objects are created in different languages, some objects are created by slovak people and then german people create the german translation for the slovak object.

some objects are only in slovak, or polish and not german maybe.

i need translateable field groups because of e.g. city informations /description need to be in the language the user used,right?

October 11, 2024 at 1:08 pm #16279826

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I understand your scenario, however, as mentioned earlier that 'll always be a problem.

However, in this case, if your user can not create first in German, then of course you'll need to refill the translation manually.

Unfortunately this is the workflow which needs to be followed for proper translation or copying of the fields.

P.S.: I'll be off for the weekend and 'll be able to attend on Monday.

October 14, 2024 at 10:12 am #16285105

sebastianV-9

if i disable acf field group translation, so i can't translate e.G City Informations right.
Why are fields filled in draft but not on publish?

October 14, 2024 at 1:05 pm #16286155

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Can you please check this guide https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/ and see if the fields as per their types, are set to correct translation preferences? Provided that the field group is set to not-translate.