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