Skip Navigation

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

Problem:
The client is experiencing an issue with the Advanced Custom Fields (ACF) flexible content where deleting a flexible content layout causes the fields from the deleted layout to display in the next section instead of being empty. This happens because the WPML translation editor does not handle empty fields as expected, leading to old values being displayed instead of empty ones.
Solution:
If you're experiencing this issue, we recommend trying one of the following solutions:
1. Add the following filter to your

functions.php

file:

add_filter('wpml_sync_deleted_custom_fields', '__return_true');

2. OR Insert a non-breaking space

 

inside your ACF value to prevent it from being empty.

Please note that this solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.

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

Last updated by Dražen Duvnjak 9 months, 2 weeks ago.

Assisted by: Dražen Duvnjak.

Author Posts
February 8, 2024 at 8:06 am #15279955

luminati-network-ltd.L

I face new issue that related to that issue.

checkbox for sync is checked: "Keep repeater and flexible sub-fields in the same order as the default language."

- I remove one flexible item from the middle of the page (it was 5)
- the section that was number 6, become 5.
- They share the same field names.
- fields that was exist on the deleted flexible item (layout) but not exist on the next section (layout) now display on the layout.

why? because contents_5_title was exist and not "override" with new field (it is empty) so now on translations it show the old values and not empty values like english

because in english there is no field. that field is not exist on wpml translation editor.

What can I do with that case?

February 8, 2024 at 8:08 am #15279958

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

1) In order to expedite handling your support requests, can you please share WPML support debug information from your site.

- To give debug information, login to your site and go to WPML → Support. From there click on the “debug information” link at the bottom of the page.
- Once on the “debug information” page, select the entire content of the text box and copy it.
- Now go back to our support forum, find debug information box and paste it.

More information on the link: https://wpml.org/faq/provide-debug-information-faster-support/

2) I am sorry but I do not understand entirely your reply and what do you mean by some sentences, for example: "fields that was exist on the deleted flexible item (layout) but not exist on the next section (layout) now display on the layout."

Can you please share a video of the issue and what happens?

3) Is the main flexible field set as COPY and subfields to Translate?

Thanks,
Drazen

February 8, 2024 at 11:49 am #15280993

luminati-network-ltd.L

Video will not help to understand the problem.

example situation for flexible content called "contents" and how it save the meta keys:
1. contents_0
1.1. contents_0_title (My Title 1)
1.2. contents_0_content (My Content 1)
2. contents_1
2.1. contents_1_title (empty)
2.2. contents_1_content (My Content 2)

Now I wil remove the "first" layout. so all "1 fields" will be "0 fields".
Because I don't have title in my contents_1_title it not replace the contents_0_title.

so On the page I will see the Content from "1" (contents_1_content) but the title from "0" (My Title 1) because it doesn't replaced.

When there are empty field in wpml translation editor it doesn't allow to "translate" it. so in translations it take "old value" if it exist

February 8, 2024 at 12:32 pm #15281177

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

as I understand issue happens when you have an empty value or? If so then that is not expected usage and you should not use empty or translate empty values when using the WPML editor.

As workaround, you can try using and adding the next filter inside your functions.php:

add_filter('wpml_sync_deleted_custom_fields', '__return_true');

Or put a

 

inside your ACF value.

Regards,
Drazen

February 11, 2024 at 3:30 pm #15290152

luminati-network-ltd.L

filter works. thanks