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?
"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
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?
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.
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.