Skip to content Skip to sidebar

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
- 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 8:00 – 12:00 6:00 – 12:00 -
- 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 13:00 – 17:00 13:00 – 15:00 -

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

This topic contains 5 replies, has 2 voices.

Last updated by Nicolas V. 10 months, 2 weeks ago.

Assisted by: Nicolas V..

Author Posts
September 3, 2024 at 10:42 am #16134948

Vitalii Kaplia

Background of the issue:
I have encountered an issue when using ACF in combination with ACFML and WPML. Specifically, this problem occurs with repeater fields in a standard WordPress post.

When the repeater field and its subfields are set to "No Translate," the repeater field correctly returns an array. However, when I change the translation settings to "Translate" for the repeater field and its subfields, the repeater field begins to return a number (1, 2, 3, etc.), depending on the number of repetitions, instead of returning an array.

This behavior significantly disrupts the expected functionality of repeater fields, as the array structure is crucial for accessing the repeated data.

Could you please investigate this issue and provide guidance or a fix?

WP: 6.6.1
ACF: 6.3.6
WPML: 4.6.13
Advanced Custom Fields Multilingual: 2.1.4.2

Thank you for your assistance.

Symptoms:

Questions:

September 3, 2024 at 11:54 am #16135423

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

Welcome to the WPML support forum. Following the recommendations from our documentation here: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/

If you want the same number of repetitions in all languages, set the repeater field to COPY. Then, set the subfields to TRANSLATE.

Please let me know if adjusting the translation preferences resolved the issue. Thank you!

September 3, 2024 at 11:57 am #16135459

Vitalii Kaplia

Hello Nicolas!

Thank you for your prompt response. However, I believe there is a misunderstanding regarding the issue I described.

The problem occurs specifically when I set the repeater field and its subfields to "Translate." In this scenario, instead of returning an array as expected, the repeater field returns a number (the count of repetitions) rather than the array of repeated fields.

I understand the recommendation to set the repeater field to "Copy" and the subfields to "Translate," but in my case, I need the repeater field and its subfields to be translatable. The issue is that when I configure it this way, the expected array structure is lost.

Could you please look into this specific issue? I believe it may require a different approach or further investigation.

Thank you for your continued assistance.

September 3, 2024 at 1:54 pm #16136045

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hi Vitalii,

I'd be happy to take a closer look, but first, please try setting the repeater field to COPY. Similar issues have been resolved this way: https://wpml.org/forums/topic/acf-repeater-field-give-the-count-of-rows-instead-of-data/#post-11969349

Repeater fields shouldn't be translated, they should either be set as COPY (to get the exact same number of repetitions) or COPY ONCE (if you want to use the WordPress editor and have a different number of repetitions). For more information you can read this section "Translating ACF Repeater Fields with WPML"

If the issue persists after changing the translation preference to COPY, please provide me with a temporary admin access – preferably to a staging copy where the issue has been replicated – so I can further investigate. I will activate a private field for your next answer where you can provide that information safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

IMPORTANT: Before we proceed, please backup your site and database.

September 9, 2024 at 9:23 pm #16158923

Vitalii Kaplia

Tested with COPY and COPY Once - still same bug. Ok, I'll prepare temporary staging for you and send credentials soon. Thanks!

September 10, 2024 at 11:17 am #16160833

Nicolas V.
Supporter

Languages: English (English ) French (Français )

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

Hello,

I've activated a private field for your next answer where you can provide that information safely (this field is only visible by you and the support team). Don't share your own admin account, create a new one that you will delete when we finish troubleshooting.

IMPORTANT: Before we proceed, please backup your site and database.

The topic ‘[Closed] Issue with ACFML Repeater Fields Returning Numbers Instead of Array with WPML Translation Enabled’ is closed to new replies.