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.

This topic contains 9 replies, has 2 voices.

Last updated by johnM-108 1 year, 3 months ago.

Assisted by: Nicolas V..

Author Posts
November 8, 2023 at 7:13 pm #14760675

johnM-108

I'm am using Advanced Custom Fields on my site. In two field instances (Checkboxes and Image), the translated page is returning different data options and breaking my site completely.

In the first instance, the Checkboxes, I have the ACF field's "Return Value" set to "Both (Array)" and my templating is expecting an array of arrays with Key => Value. It works on the original (English) page but for the translated version (Dutch) it's returning an array of only the Key.

In the second instance, the Image, I have the ACF field's "Return Format" set to "Image Array" and my templating is expecting that array of image information. It works on the original (English) page but for the translated version (Dutch) it's simply returning the ID of the image object as a String.

I've searched for solutions online and tried a few, but nothing has helped.

November 8, 2023 at 7:52 pm #14760941

johnM-108

UPDATE: The problem I describe above occurs immediately after translation. So, I translate a post and it appears as a DRAFT. If I preview that post, it's broken as described.

But, if I edit the draft and DO NOT touch anything and just click "Save Draft" that fixes the issues above.

While, this approach "fixes" the issue it's not really a "fix" is it?

November 9, 2023 at 7:03 pm #14770633

Nicolas V.
Supporter

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

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

Hello,

Welcome to the WPML support forum. Let's start by meeting WPML's minimum requirements. I've noticed your website has a low PHP memory allocation (64M). The minimum requirement for WPML is 128M but we recommend 256M:

- Access your server via FTP and open wp-config.php (in your WordPress root directory).
- Insert those lines just before /* That's all, stop editing! Happy blogging. */

/* Memory Limit */
define( 'WP_MEMORY_LIMIT', '256M' );

More info: https://wpml.org/home/minimum-requirements/

---

Now regarding your ACF fields, could you give me more details?
- First how do you translate your pages: using our Advanced Translation Editor (ATE) or the WordPress Editor? (That will help determine the translation preferences for your fields)
- What are the translation preferences for those fields? (Copy / Copy once / Translate). You can find that information in "ACF > Field Groups". Edit your Field group and check the translation preference for each field.
- Are those fields inside a special field such as "Flexible content", "Repeater" or "Tab"?

November 10, 2023 at 2:24 pm #14777601

johnM-108

The "WP_MEMORY_LIMIT" has been configured as you've asked.

ACF Field Information
- In the instances mentioned above, we've only used the automatic translation option. We goto WPML > Translation Management. Then we check the checkboxes next to the posts we want to translate, scroll down to "How do you want to translate?" and selection "Translate automatically".
- For the images, some were set to "Don't Translate" and some were set to "Copy"
- Looks like most of the instances were inside a Tab.

November 10, 2023 at 8:27 pm #14780241

Nicolas V.
Supporter

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

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

Hi,

Thanks for your reply. In that case, the image fields should be set as "COPY" (don't use "Don't translate"). And for the parent field "Tab" it should be set on "COPY" too.

For more info: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/
When using automatic translation, you should follow the recommendation from the "Same fields across languages" column.
Even better, you can go directly to "ACF > Field Groups", edit that group and use the Multilingual setup "Same fields across languages" that way you're sure that your group is correctly setup.
Ref: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#selecting-a-translation-option

- Then go back to the original page and make a small edit (add a space at the end of the title) and save. Then wait for the automatic translation to update and re-validate that translation. That should be enough to update the translation with the changes you made.

November 16, 2023 at 6:42 pm #14830041
johnM-108

I cannot test this out until I get an issue related to multisite in a development environment figured-out as I can't do this on my live site. I'm having trouble figuring out how to open a new ticket for this issue. WPML support keeps sending me in circles.

New threads created by Nicolas V. and linked to this one are listed below:

https://wpml.org/forums/topic/split-translated-custom-fields-returning-different-data/

November 17, 2023 at 2:23 pm #14863539

Nicolas V.
Supporter

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

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

Hello,

If I understand correctly you need to configure your multisite first and need to open a new ticket for that?

I have opened a new ticket this. Let's continue our conversation on that new ticket: https://wpml.org/forums/topic/split-translated-custom-fields-returning-different-data/

November 17, 2023 at 3:44 pm #14864775

johnM-108

I've responded there.

November 19, 2023 at 12:17 pm #14870507

Nicolas V.
Supporter

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

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

Hi,

Ok, I will still keep that ticket open waiting for your feedback. That way, once you solve the other ticket you can come back and we can continue here.

Have a great day

November 27, 2023 at 1:57 pm #14930741

johnM-108

Bumping this ticket just to keep it alive while we work-out the issues in the split ticket.

December 7, 2023 at 7:08 pm #15020509

johnM-108

This issue wasn't resolved. The ticket that was split from this one is on-going. I'm going to close this ticket and start over from scratch when that one is finally resolved.