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
- 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 11:00 – 15:00 -
- 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 16:00 – 20:00 -

Supporter timezone: Europe/Rome (GMT+01:00)

This topic contains 6 replies, has 0 voices.

Last updated by Laura 6 months ago.

Assisted by: Laura.

Author Posts
July 21, 2025 at 3:15 pm #17256422

Marie-Aude

Background of the issue:
I am trying to translate a repeater field with three subfields using WPML. The first and third subfields should be copied, while the second should be translated. The fields appear in the translation interface, but I encounter a system error when saving the translated post. I attempted to resolve this by replacing wpml_cf_preferences with copy_once, but it did not help.

Symptoms:
I can't save the translated post due to a system error, and only half of the meta are created in the postmeta table. For example, the original post has two meta keys, llnadvseo_update and _llnadvseo_update, but the translated post only has llnadvseo_update.

Questions:
Why are only half of the meta keys created in the postmeta table for the translated post?

July 23, 2025 at 1:17 pm #17264092

Laura
WPML Supporter since 05/2018

Languages: English (English ) Italian (Italiano )

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

Hi,

Thanks for contacting us.

What is the System error you're encountering?

July 23, 2025 at 3:58 pm #17264714

Marie-Aude

"Il y a eu une erreur critique sur ce site. Veuillez vérifier la boîte de réception de votre e-mail d’administration pour obtenir des instructions. Si vous continuez à avoir des problèmes, essayez le forum de support."

"There has been a critical error on this site. Please check your administration email inbox for instructions. If you continue to have problems, try the support forum."

And in the debug log

'"[23-Jul-2025 15:53:01 UTC] PHP Fatal error: Uncaught ValueError: max(): Argument #1 ($value) must contain at least one element in /home/xxx/xxx/wp-content/plugins/lln-magical-stuff/functions/post-functions/updates.php:117
Stack trace:
#0 /home/xxx/xxx/wp-content/plugins/lln-magical-stuff/functions/post-functions/updates.php(117): max()
#1 /home/xxx/xxx/wp-content/plugins/lln-magical-stuff/functions/post-functions/updates.php(135): lln_get_last_update()
#2 /home/xxx/xxx/wp-content/plugins/lln-magical-stuff/functions/post-functions/updates.php(177): lln_last_update_fields()
#3 /home/xxx/xxx/wp-includes/class-wp-hook.php(326): lln_filter_update_dates()
#4 /home/xxx/xxx/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#5 /home/xxx/xxx/wp-includes/post.php(4811): apply_filters()
#6 /home/xxx/xxx/wp-includes/post.php(5212): wp_insert_post()
#7 /home/xxx/xxx/wp-admin/includes/post.php(453): wp_update_post()
#8 /home/xxx/xxx/wp-admin/post.php(227): edit_post()
#9 {main}
thrown in /home/xxx/xxx/wp-content/plugins/lln-magical-stuff/functions/post-functions/updates.php on line 117"'

Which comes from the fact that the fields _llnadvseo_update, _llnadvseo_update_0_content,
_llnadvseo_update_0_date and _llnadvseo_update_0_display are not inserted in the database

July 23, 2025 at 5:19 pm #17265136

Laura
WPML Supporter since 05/2018

Languages: English (English ) Italian (Italiano )

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

The error is caused by the plugin "Magical Stuff by Lumiere de Lune" which I see it's a custom plugin. I don't know what it does, did you try if deactivating it you still have the issue?

July 24, 2025 at 9:04 am #17266582

Marie-Aude

The issue is not in the custom plugin.
The custom plugin has a certain number of functionnalities, including the php definition of ACF fields.

Within these fields, there is a repeated field called llnadvseo_update with three subfields :
llnadvseo_update_0_date
llnadvseo_update_0_content
llnadvseo_update_0_display
that can be repeated :
llnadvseo_update_1_date
llnadvseo_update_1_content
llnadvseo_update_1_display
etc...

ACF, for each custom field, registers two meta in the table postmeta,
in that case
llnadvseo_update with the content as meta value
and _llnadvseo_update with the reference to the field as meta value

llnadvseo_update_0_date and _llnadvseo_update_0_date
etc...

The problem is that when I translate the post, the meta with _ , that are necessary for ACF, are not generated, as I showed in the screenshot.
Hence, when going to the translated post and trying to save it, the error, that disappears when I manually create the missing post meta directly in phpmyadmin.

So,
1- I can't deactivate the plugin, but if I could, the fields would not exist anymore, hence no problem
2- The problem is a bug in how the translation of repeater fields with subfields is handled.

Here is the definition of the fields :
acf_add_local_field_group(array(
'key' => 'group_5db81bb45e051',
'title' => __('Old contents update', 'lln_magic'),
'fields' => array(
array(
'key' => 'field_5db81bcf0bdbb',
'label' => __('Update', 'lln_magic'),
'name' => 'llnadvseo_update',
'type' => 'repeater',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'collapsed' => 'field_5db81bf80bdbc',
'layout' => 'table',
'button_label' => '',
'wpml_cf_preferences' => 1,
'sub_fields' => array(
array(
'key' => 'field_5db81bf80bdbc',
'label' => __('Date', 'lln_magic'),
'name' => 'date',
'type' => 'date_time_picker',
'instructions' => __('Date of the update, usually just when you enter it. Click on "now" and validate.', 'lln_magic'),
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'parent_repeater' => 'field_5db81bcf0bdbb',
'display_format' => 'd/m/Y',
'return_format' => 'd/m/Y',
'first_day' => 1,
'wpml_cf_preferences' => 1
),
array(
'key' => 'field_5db81c360bdbd',
'label' => __('Content', 'lln_magic'),
'name' => 'content',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'parent_repeater' => 'field_5db81bcf0bdbb',
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 1,
'delay' => 0,
'wpml_cf_preferences' => 2
),
array(
'key' => 'field_5e97849c25d83',
'label' => __('Display detail', 'lln_magic'),
'name' => 'display',
'type' => 'true_false',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => __('Uncheck if you do not want to display the content of the update on the post', 'lln_magic'),
'parent_repeater' => 'field_5db81bcf0bdbb',
'default_value' => 1,
'ui' => 0,
'ui_on_text' => '',
'ui_off_text' => '',
'wpml_cf_preferences' => 1
),
),
),
),
'location' => $locations,
'acfml_field_group_mode' => 'advanced',
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => 1,
));
}

July 24, 2025 at 7:48 pm #17269151

Laura
WPML Supporter since 05/2018

Languages: English (English ) Italian (Italiano )

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

Thanks for the explanation. I sent the ticket to the 2nd tier, I'll let you know as soon as possible.

July 25, 2025 at 2:56 pm #17271653

Laura
WPML Supporter since 05/2018

Languages: English (English ) Italian (Italiano )

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

We have a known issue related to ACF fields added via PHP which might be related to yours: https://wpml.org/errata/advanced-custom-fields-local-fields-translation-preference-issue-for-php-registered-system-fields/

Would it be possible to check if using a JSON solves the issue?
Or, if the fields appear in ACF interface, you might try to set the translation preferences there.

The topic ‘[Closed] ACML repeater fields don’t translate correctly’ is closed to new replies.