Skip Navigation

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

Problem:
If you're experiencing a 500 error when saving changes to widgets that include custom ACF-Gutenberg blocks with a Repeater field containing radio buttons and a select field, and the error message is 'strlen(): Argument #1 ($string) must be of type string, array given', this might be due to the way the fields are registered.
Solution:
We recommend adding

'wpml_cf_preferences' => 1,

to your repeater field in the ACF field settings. This adjustment should resolve the error. Additionally, ensure that you have registered the ACF Pro plugin and installed the Advanced Custom Fields Multilingual plugin to fully support multilingual functionality.

If this solution does not apply to your case, or if it seems outdated, please check the related known issues and verify that you have installed the latest versions of themes and plugins. If the issue persists, we highly recommend opening a new support ticket at WPML support forum for further assistance.

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 0 reply, has 0 voices.

Last updated by dmytroH-2 2 months, 2 weeks ago.

Assisted by: Noman.

Author Posts
February 24, 2025 at 9:09 am #16739440

dmytroH-2

Background of the issue:
I am encountering an issue when using WPML with ACF custom Gutenberg blocks inside widgets. I have widgets that include Gutenberg blocks (custom ACF-Gutenberg blocks) with a Repeater field containing radio buttons and a select field.

Symptoms:
When I try to save changes to these widgets, I encounter the 500 error: 'strlen(): Argument #1 ($string) must be of type string, array given' on the first save attempt.

I logged the $string variable during the process. Its value was: {"field_cta_buttons_button_type":"static_auth_buttons","field_cta_buttons_button_style":"primary","field_cta_buttons_static_auth_button":"registration"}.

Questions:
How can I resolve the error when saving changes to widgets with ACF-Gutenberg blocks?

February 24, 2025 at 9:28 am #16739652

dmytroH-2

could you please provide ACF pro version in sandbox admin panel? Because i need Repeater field

February 24, 2025 at 10:12 am #16740031

dmytroH-2

I see that you have installed the ACF Pro, but the license is still not activated. Can you activate the license so that I can access the creation of the repeater?

February 24, 2025 at 12:01 pm #16740763

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I have registered the ACF Pro plugin. Could you please try to replicate the issue and share the steps you follow? Let us know if you need anything else from our side. Thank you!

February 24, 2025 at 1:02 pm #16741114

dmytroH-2

Thanks, i also need Advanced Custom Fields Multilingual plugin. Could you install please?

February 24, 2025 at 1:19 pm #16741153

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I have installed the Advanced Custom Fields Multilingual plugin as requested. Please check and let us know if you need anything else. Thank you!

February 24, 2025 at 4:47 pm #16742272

dmytroH-2

i found mistake, needed to add 'wpml_cf_preferences' => 1,
to my repeater field. and after that everything works fine, thank you for support

February 24, 2025 at 4:48 pm #16742302

dmytroH-2

i found mistake, needed to add 'wpml_cf_preferences' => 1,
to my repeater field. and after that everything works fine, thank you for support