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.

Sun Mon Tue Wed Thu Fri Sat
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 0 replies, has 0 voices.

Last updated by Noman 2 months, 3 weeks ago.

Assisted by: Noman.

Author Posts
January 29, 2025 at 9:26 am #16645167

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

Symptoms:
When I try to save changes to these widgets, I encounter the error: 'strlen(): Argument #1 ($string) must be of type string, array given' on the first save attempt. If I click the 'Update' button a second time, the changes are saved successfully. Additionally, when I remove all blocks from a widget and try to re-add the block, I get a different error: 'md5(): Argument #1 ($string) must be of type string, array given'.

Questions:
How can I resolve the error when saving changes to widgets with ACF-Gutenberg blocks?
What causes the md5 error when re-adding blocks to a widget?

January 29, 2025 at 11:04 am #16645721

dmytroH-2

I did as indicated in the topic https://wpml.org/forums/topic/fatal-error-when-trying-to-add-a-translation-for-a-page/page/2/#post-13350115

set for the acf fields of this block 'wpml_cf_preferences' => 0, deleted the blocks from the widgets, and then added new ones, and when I try to save I get the same error

{"context":{"userId":1,"exception":{"class":"TypeError","message":"strlen(): Argument #1 ($string) must be of type string, array given","code":0,"file":"\/app\/web\/app\/plugins\/wpml-string-translation\/classes\/filters\/strings-filter\/class-wpml-register-string-filter.php:205"}},"level":400,"level_name":"ERROR","channel":"local","datetime":"2025-01-29T11:00:55.686611+00:00","extra":[],"short_message":"strlen(): Argument #1 ($string) must be of type string, array given"}
January 29, 2025 at 3:54 pm #16647682

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Thanks for trying it. Could you please try to replicate the issue at the fresh WP site so that we can escalate it to our compatibility team. Here will be the steps:

1. Login to the fresh WP site by clicking on the auto login URL: hidden link

2. Install the required plugin.

3. Try to use the Gutenberg blocks in Widgets as you did on your site.

Please note that we only need the specific ACF/Gutenberg functionality on this site; there’s no need to set up a full site or clone your existing one.

Please let us know with the steps which you followed on the fresh WP site.

Thank you for your cooperation

The topic ‘[Closed] Error with ACF-Gutenberg Blocks in Widgets when Using WPML’ is closed to new replies.