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.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 1 year, 2 months ago.

Assisted by: Christopher Amirian.

Author Posts
October 13, 2023 at 8:03 pm #14575181

chrisD-39

Custom widget blocks created using ACF prevent the Widgets from being updated within the Dashboard. On save, a fatal error message is shown and the widget is moved to the Inactive Widgets section. Checking the logs, we see the error is in the WPML_Register_String_Filter->save_string first argument. Log output included below:

{
  "environment": "DEV",
  "type": "error",
  "date": "2023-10-13T19:49:23.966Z",
  "severity": null,
  "client": null,
  "message": "PHP Fatal error:  Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, array given in /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/classes/filters/strings-filter/class-wpml-register-string-filter.php:205#012Stack trace:#012#0 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/classes/filters/strings-filter/class-wpml-register-string-filter.php(184): WPML_Register_String_Filter->save_string(Array, false, 'en', 'block-widget', '', '2dec21867e609ce...')#012#1 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/functions.php(214): WPML_Register_String_Filter->register_string('', '2dec21867e609ce...', Array, false, 'en')#012#2 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/package-translation/inc/wpml-package.class.php(313): icl_register_string('block-widget', '2dec21867e609ce...', Array, false, 'en')#012#3 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/package-translation/inc/wpml-package-translation-helper.class.php(532): WPML_Package->get_string_id_from_package('2dec21867e609ce...', Array)#012#4 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/package-translation/inc/wpml-package-translation-helper.class.php(176): WPML_Package_Helper->get_string_id_from_package(Object(WPML_Package), '2dec21867e609ce...', Array)#012#5 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/package-translation/inc/wpml-package-translation-helper.class.php(148): WPML_Package_Helper->register_string_with_wpml(Object(WPML_Package), '2dec21867e609ce...', 'mssrc/press-too...', 'array', Array)#012#6 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/package-translation/inc/wpml-package-translation-helper.class.php(82): WPML_Package_Helper->register_string_for_translation(Array, '2dec21867e609ce...', Object(WPML_Package), 'mssrc/press-too...', 'array')#012#7 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(310): WPML_Package_Helper->register_string_action(Array, '2dec21867e609ce...', Array, 'mssrc/press-too...', 'array')#012#8 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)#012#9 /nas/content/live/sourceasiadev/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#012#10 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Gutenberg/class-wpml-gutenberg-strings-registration.php(115): do_action('wpml_register_s...', Array, '2dec21867e609ce...', Array, 'mssrc/press-too...', 'array')#012#11 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Gutenberg/class-wpml-gutenberg-strings-registration.php(144): WPML_Gutenberg_Strings_Registration->register_blocks(Array, Array, NULL)#012#12 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Gutenberg/class-wpml-gutenberg-strings-registration.php(80): WPML_Gutenberg_Strings_Registration->register_blocks(Array, Array, NULL)#012#13 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Gutenberg/class-wpml-gutenberg-integration.php(73): WPML_Gutenberg_Strings_Registration->register_strings_from_widget(Array, Array)#012#14 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Gutenberg/Widgets/Block/RegisterStrings.php(20): WPML_Gutenberg_Integration->register_strings_from_widget(Array, Array)#012#15 [internal function]: WPML\\PB\\Gutenberg\\Widgets\\Block\\RegisterStrings->WPML\\PB\\Gutenberg\\Widgets\\Block\\{closure}(Array, Array)#012#16 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(321): call_user_func_array(Object(Closure), Array)#012#17 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): WPML\\FP\\Fns::WPML\\FP\\{closure}(Array, Array)#012#18 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\\FP\\{closure}(Array)#012#19 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\\FP\\Right->map(Object(Closure))#012#20 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\\FP\\Right->chain(Object(Closure))#012#21 /nas/content/live/sourceasiadev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\\FP\\Promise->resolve(Object(WPML\\FP\\Right))#012#22 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(312): WPML\\LIB\\WP\\Hooks::WPML\\LIB\\WP\\{closure}(Array, Array)#012#23 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)#012#24 /nas/content/live/sourceasiadev/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#012#25 /nas/content/live/sourceasiadev/wp-includes/option.php(581): do_action('update_option_w...', Array, Array, 'widget_block')#012#26 /nas/content/live/sourceasiadev/wp-content/plugins/wpml-string-translation/inc/functions.php(152): update_option('widget_block', Array)#012#27 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(312): wpml_st_init_register_widget_titles(Array)#012#28 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)#012#29 /nas/content/live/sourceasiadev/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#012#30 /nas/content/live/sourceasiadev/wp-includes/option.php(581): do_action('update_option_s...', Array, Array, 'sidebars_widget...')#012#31 /nas/content/live/sourceasiadev/wp-includes/widgets.php(1094): update_option('sidebars_widget...', Array)#012#32 /nas/content/live/sourceasiadev/wp-includes/widgets.php(1963): wp_set_sidebars_widgets(Array)#012#33 /nas/content/live/sourceasiadev/wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php(334): wp_assign_widget_to_sidebar('block-14', 'sidebar-spotlig...')#012#34 /nas/content/live/sourceasiadev/wp-includes/rest-api/class-wp-rest-server.php(1194): WP_REST_Widgets_Controller->update_item(Object(WP_REST_Request))#012#35 /nas/content/live/sourceasiadev/wp-includes/rest-api/class-wp-rest-server.php(1734): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wp/v2/widgets/...', Array, NULL)#012#36 /nas/content/live/sourceasiadev/wp-includes/rest-api/class-wp-rest-server.php(1194): WP_REST_Server->serve_batch_request_v1(Object(WP_REST_Request))#012#37 /nas/content/live/sourceasiadev/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/batch/v1', Array, NULL)#012#38 /nas/content/live/sourceasiadev/wp-includes/rest-api/class-wp-rest-server.php(431): WP_REST_Server->dispatch(Object(WP_REST_Request))#012#39 /nas/content/live/sourceasiadev/wp-includes/rest-api.php(418): WP_REST_Server->serve_request('/batch/v1')#012#40 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(310): rest_api_loaded(Object(WP))#012#41 /nas/content/live/sourceasiadev/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)#012#42 /nas/content/live/sourceasiadev/wp-includes/plugin.php(565): WP_Hook->do_action(Array)#012#43 /nas/content/live/sourceasiadev/wp-includes/class-wp.php(398): do_action_ref_array('parse_request', Array)#012#44 /nas/content/live/sourceasiadev/wp-includes/class-wp.php(779): WP->parse_request('')#012#45 /nas/content/live/sourceasiadev/wp-includes/functions.php(1335): WP->main('')#012#46 /nas/content/live/sourceasiadev/wp-blog-header.php(16): wp()#012#47 /nas/content/live/sourceasiadev/index.php(17): require('/nas/content/li...')#012#48 {main}#012  thrown in /nas/content/live/sourceasiadev/wp-content/plug",
}

Bug confirmed by temporarily downgrading the environment to PHP 8.0, which resolved the error. Our host has scheduled the end of life for PHP 8.0 for all customers by the end of this month, so keeping it on that version is not a viable option.

October 15, 2023 at 1:26 pm #14579599

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi there,

WPML is not officially compatible with PHP 8.2 yet, and the issue is WordPress itself is not compatible with PHP 8.2 officially yet so it will take time for WordPress and WordPress plugins to adapt and finalize.

There is no ETA for a compatible release but our development team are working on a release.

Thank you.

October 16, 2023 at 5:03 pm #14587413

chrisD-39

Thank you for the information - we'll look forward to the update 🙂