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

Last updated by Konrad Karpieszuk 7 months, 1 week ago.

Assigned support staff: Konrad Karpieszuk.

Author Posts
March 6, 2019 at 9:58 pm #3281453

charlottev-6

Hi,

I'am using a Repeater field of Advanced Custom Field PRO (ACF-PRO). When translating a post, the repeater fields are saved, but are not visible in the Front End view of the page.

Digging into the database, it seems the system fields (starting with the underscore _) are not saved / set. When editing the translated post in the default editor (not the WPML's Translation Editor), all translated Custom fields are visible and wie pressing Update all system fields are generated properly (shown in database). Also the repeater field is visible in Frond-End of the site.

The system fields containing

 field_5910262d0c588

are important to let functions of ACF like

have_rows()

and

the_row();

work properly.

How can I get the repeater field work properly?

WordPress 4.9.6

WPML Media 2.5.1
WPML Multilingual CMS 4.2.4.1
WPML String Translation 2.10.2
WPML Translation Management 2.8.3

Advanced Custom Fields Multilingual 1.1
Advanced Custom Fields PRO 5.7.13

March 7, 2019 at 9:24 am #3283154

Konrad Karpieszuk
Supporter

Languages: English (English )

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

hello

while you are on the post/page edit screen, in translation preferences metabox please click "show system fields" and the you will see translation preferemces for fields with _ on the beginning. then please set translation prferences for that field to "copy"

March 7, 2019 at 12:11 pm #3284233

charlottev-6

Hi Konrad,
thnx again for the reply.

In the meantime after some testing, I figured out copying the system fields regarding ACF custom fields indeed does the trick. The filenames are only unique for the ACF-field name and equal for all post-id (first I thought this ID differs per post).
So the best way is to set the translation settings for repeater fields in the wpml-config.xml like:

<custom-field action="copy">_event_additional_information</custom-field>
		<custom-field action="copy">_event_additional_information_0_label</custom-field>
		<custom-field action="copy">_event_additional_information_0_information</custom-field>
		<custom-field action="copy">_event_additional_information_1_label</custom-field>
		<custom-field action="copy">_event_additional_information_1_information</custom-field>
		<custom-field action="copy">_event_additional_information_2_label</custom-field>
		<custom-field action="copy">_event_additional_information_2_information</custom-field>
		<custom-field action="copy">_event_additional_information_3_label</custom-field>
		<custom-field action="copy">_event_additional_information_3_information</custom-field>
		<custom-field action="copy">_event_additional_information_4_label</custom-field>
		<custom-field action="copy">_event_additional_information_4_information</custom-field>

Do you really need to set all individual _event_additional_information_*_label because you cannot use a wildcard in wpml-config.xml for costom fields 🙁

March 8, 2019 at 9:01 am #3290314

Konrad Karpieszuk
Supporter

Languages: English (English )

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

Hi,

In the other ticket https://wpml.org/forums/topic/unable-to-save-custom-field-translation-settings-when-acf-ml-is-installed/ I shared the code to set preferences programmatically. I think you can use it - modified - in other parts of your code to set system fields when dealing with repeaters