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.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 6 replies, has 3 voices.

Last updated by Andreas W. 2 months, 1 week ago.

Assisted by: Andreas W..

Author Posts
September 19, 2024 at 9:24 pm #16200808

vivekP

Background of the issue:
I am trying to assess what is wrong with JSON-based field definition "Support Landing" across multiple languages. The field groups were defined per language as this site predates ACF-WPML integration, so the base language group does Copy Once and the other languages are Don't Translate. The page and its ACF data has functioned correctly for several years and just recently started misbehaving. Link to a page where the issue can be seen: hidden link

Symptoms:
PHP error messages indicating the results from get_field/get_fields do not include the correct field group data. Database postmeta is consistent with the definition but is being ignored.

Questions:
Why are the field group updates not being respected in the rendering page template even after JSON sync?
What could be causing the PHP error messages related to get_field/get_fields?
Why is the database postmeta being ignored despite being consistent with the definition?

September 20, 2024 at 6:04 am #16201258

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

1) Please note field groups should be set to do not translate, and you should have only 1 set of field groups, which then have fields that have translation settings. Having field groups translated can cause issue and is not recommended. Please check if that helps.

2) Does the error and issue also happen without WPML plugins?

3) Can you check if the issue still happens with only WPML plugins and ACF, while using the WP default theme? Since you are using custom-coded theme, it is not in our scope to debug custom solutions.

Let us know how it goes.

Regards,
Drazen

September 25, 2024 at 9:04 pm #16222540

vivekP

With the understanding that I implemented this field group independently across all languages 6-7 years ago (this was before ACFML was a thing), my presumption is that the new paradigm causes old workarounds to break, I decided to start fresh, deactivate the old field group (and its cousins in the other languages), and start a fresh one that contained the exact same field definitions, hoping that calls to the metadata would pick up the old values (by field machine name) and prevent a tedious re-entering of all content.

Initially, I set the field group to "Same fields across languages" as I knew the field definitions themselves would not change between languages - the field group was visible and accessible in the default language (and did grab the old values!), however, the field group does not appear for editing in the translated languages at all.

Does the field group itself need to be translated (or just duplicated if we don't care about back-end translation), and if so, what should the Multilingual Setup setting be for this field group if we anticipate different languages to have varying repeater contents?

Waiting for a response before continuing further.

September 26, 2024 at 4:20 am #16222979

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

Hello,

The field group should only be set to "Same fields across languages" if you are translating the field with the WPML Translation Editor.

For translating the fields with the WordPress Editor please set the field group to "Different fields across languages".

Also, make sure that ACF Field Groups are set to "Not translatable" and any duplicated field groups are deleted.

If this is not a solution for you, take note that you might not need ACFML if you are not planing to translate any of the field groups with the WPML Translation Editor.

Does the error disappear if you disable ACFML?

Best regards
Andreas

September 26, 2024 at 2:30 pm #16225946

vivekP

I noticed that if I set acf-field-group to "Not translatable" then all my duplicate field groups now show up in all languages, which is something I can work towards resolving but will need time to make sure all languages still behave correctly. However, the fatal error did go away at that point.

If some of my field groups have dropdowns/radio buttons where the labels will still need to be translated, how will I implement that with the above change?

I believe there may still be situations where the Translation Editor will be used instead of editing the fields in place in each translated page/post, so for the moment I'm keeping those.

September 26, 2024 at 3:04 pm #16226187

vivekP

Also, now that I've switched field groups to "Not Translatable", *some* of the fields in the group no longer show up in get_fields() arrays, and calling them directly via get_field() results in an integer (the count of the repeater they represent) and not the array I am expecting.

September 26, 2024 at 6:00 pm #16227144

Andreas W.
Supporter

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

Timezone: America/Lima (GMT-05:00)

If you use the WordPress Editor for translating the pages or posts that are holding the fields, then please set each field group to "Different fields across languages" in ACF.

Please test it this solves the latest issue.

Labels and choices for input fields can be translated with WPML > String Translation:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/translating-acf-field-labels-with-wpml/

The topic ‘[Closed] Field group updates not being respected in rendering page template even after JSON sync’ is closed to new replies.