Skip Navigation

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

Problem:
After updating WPML and other plugins, a critical error occurs on some WooCommerce product pages when the WPML String Translation plugin is active. Deactivating the plugin resolves the issue temporarily.
Solution:
To permanently fix the issue, modify the code in two files:
1. Navigate to

/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/DataConvert.php

and replace the unserializeString function with the following code:

private static function unserializeString( $string, $associative ) {<br />    // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_unserialize<br />    $value = is_serialized( $string ) ? unserialize( $string ) : json_decode( $string, $associative );<br />    if ($value === null){<br />        return $string;<br />    }<br />    return $value;<br />}

2. Go to

/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/QueryFilter.php

and replace the translateQueryIds function with:

public function translateQueryIds( $value, $object_id, $meta_key, $single ) {<br />    if ( WPML_Elementor_Data_Settings::META_KEY_DATA === $meta_key && $single ) {<br />        $value = get_post_meta( $object_id, WPML_Elementor_Data_Settings::META_KEY_DATA, true );<br />        if ( $value ) {<br />            $value = DataConvert::unserialize( $value, false );<br />            $value = this->recursivelyTranslateQueryIds( $value );<br />            if (is_array($value)) {<br />                $value = DataConvert::serialize($value, false);<br />            }<br />        }<br />    }<br /><br />    return $value;<br />}

After making these changes, save the files. This solution was successfully applied to a staging site, resolving the issue.

Please note that this solution might be outdated or not applicable to your specific case. If the problem persists, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket.

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

Last updated by Carlos Rojas 1 month, 2 weeks ago.

Assisted by: Carlos Rojas.

Author Posts
May 4, 2025 at 4:51 am #16992680

marikaK

Background of the issue:
I updated my site with all the available updates, including WPML. After the update, I discovered that some of the products on the single product page are not opening, and there is a critical error message. I found that uninstalling the WPML String Translation plugin resolves the issue, and the products open correctly. For example, this product: hidden link works fine when the plugin is deactivated.

Symptoms:
Critical error on some WooCommerce product links when WPML String Translation plugin is active.

Questions:
How to solve the critical error caused by the WPML String Translation plugin?

May 6, 2025 at 12:46 pm #17001669

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting us

Please follow these steps to obtain more information regarding the cause of the error:
- Create a full site backup
- Activate the WordPress debug mode as described in this link: https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/
- Reproduce the fatal error
- Share the fatal error message that appears in the browser or the debug.log file located within the wp-content folder

Looking forward to your message.
Regards,
Carlos

May 6, 2025 at 4:50 pm #17002920

marikaK

Hello, Carlos!

Hope I did as requested..
See error message attached.

P.s. I see that there is written something about elementor.. Just want to mention I have newest versions of WPML and Elementor and everything else is up to date as well..

critical-error-message.JPG
May 7, 2025 at 6:25 am #17004368

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hi,
Thank you for your message

However, I'll need you to share the complete fatal error message so I can understand what is happening.

May 7, 2025 at 6:40 am #17004415

marikaK

I can't upload full error log document, so see attached screenshot.

full-critical-error-message.JPG
May 7, 2025 at 6:54 am #17004534

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Please copy the fatal error from line 1122724 to line 1122766 and paste it in your next message.

May 7, 2025 at 7:05 am #17004627

marikaK

null given, called in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/QueryFilter.php on line 34 and defined in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/DataConvert.php:13
Stack trace:
#0 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/QueryFilter.php(34): WPML\PB\Elementor\DataConvert::serialize()
#1 [internal function]: WPML\PB\Elementor\Hooks\QueryFilter->translateQueryIds()
#2 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(358): call_user_func_array()
#3 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): WPML\FP\Fns::WPML\FP\{closure}()
#4 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\FP\{closure}()
#5 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\FP\Right->map()
#6 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\FP\Right->chain()
#7 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\FP\Promise->resolve()
#8 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(326): WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}()
#9 /home4/vintekol/orberg.lv/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#10 /home4/vintekol/orberg.lv/wp-includes/meta.php(647): apply_filters()
#11 /home4/vintekol/orberg.lv/wp-includes/meta.php(586): get_metadata_raw()
#12 /home4/vintekol/orberg.lv/wp-includes/post.php(2665): get_metadata()
#13 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1025): get_post_meta()
#14 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1106): Elementor\Core\Base\Document->get_json_meta()
#15 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1893): Elementor\Core\Base\Document->get_elements_data()
#16 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/includes/frontend.php(708): Elementor\Core\Base\Document->update_runtime_elements()
#17 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/includes/frontend.php(686): Elementor\Frontend->handle_page_assets()
#18 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/enqueue.php(601): Elementor\Frontend->enqueue_styles()
#19 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): woodmart_enqueue_base_styles()
#20 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#21 /home4/vintekol/orberg.lv/wp-includes/plugin.php(517): WP_Hook->do_action()
#22 /home4/vintekol/orberg.lv/wp-includes/script-loader.php(2299): do_action()
#23 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts()
#24 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#25 /home4/vintekol/orberg.lv/wp-includes/plugin.php(517): WP_Hook->do_action()
#26 /home4/vintekol/orberg.lv/wp-includes/general-template.php(3192): do_action()
#27 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/header.php(12): wp_head()
#28 /home4/vintekol/orberg.lv/wp-includes/template.php(810): require_once('/home4/vintekol...')
#29 /home4/vintekol/orberg.lv/wp-includes/template.php(745): load_template()
#30 /home4/vintekol/orberg.lv/wp-includes/general-template.php(48): locate_template()
#31 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-layout-type.php(45): get_header()
#32 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-single-product.php(76): XTS\Modules\Layouts\Layout_Type->before_template_content()
#33 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-single-product.php(64): XTS\Modules\Layouts\Single_Product->display_template()
#34 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): XTS\Modules\Layouts\Single_Product->override_template()
#35 /home4/vintekol/orberg.lv/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#36 /home4/vintekol/orberg.lv/wp-includes/template-loader.php(104): apply_filters()
#37 /home4/vintekol/orberg.lv/wp-blog-header.php(19): require_once('/home4/vintekol...')
#38 /home4/vintekol/orberg.lv/index.php(17): require('/home4/vintekol...')
#39 {main}
thrown in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/DataConvert.php on line 13

May 7, 2025 at 7:22 am #17004701

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Sorry, I made a mistake. The starting line is 1122723, the previous one that contains 'Fatal Error'. Could you paste the full error message again?

May 7, 2025 at 7:23 am #17004702

marikaK

Yes, of course 🙂

[06-May-2025 16:39:48 UTC] PHP Fatal error: Uncaught TypeError: WPML\PB\Elementor\DataConvert::serialize(): Argument #1 ($data) must be of type array,
null given, called in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/QueryFilter.php on line 34 and defined in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/DataConvert.php:13
Stack trace:
#0 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/QueryFilter.php(34): WPML\PB\Elementor\DataConvert::serialize()
#1 [internal function]: WPML\PB\Elementor\Hooks\QueryFilter->translateQueryIds()
#2 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(358): call_user_func_array()
#3 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(17): WPML\FP\Fns::WPML\FP\{closure}()
#4 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\FP\{closure}()
#5 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(257): WPML\FP\Right->map()
#6 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Promise.php(24): WPML\FP\Right->chain()
#7 /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/Hooks.php(50): WPML\FP\Promise->resolve()
#8 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(326): WPML\LIB\WP\Hooks::WPML\LIB\WP\{closure}()
#9 /home4/vintekol/orberg.lv/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#10 /home4/vintekol/orberg.lv/wp-includes/meta.php(647): apply_filters()
#11 /home4/vintekol/orberg.lv/wp-includes/meta.php(586): get_metadata_raw()
#12 /home4/vintekol/orberg.lv/wp-includes/post.php(2665): get_metadata()
#13 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1025): get_post_meta()
#14 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1106): Elementor\Core\Base\Document->get_json_meta()
#15 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/core/base/document.php(1893): Elementor\Core\Base\Document->get_elements_data()
#16 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/includes/frontend.php(708): Elementor\Core\Base\Document->update_runtime_elements()
#17 /home4/vintekol/orberg.lv/wp-content/plugins/elementor/includes/frontend.php(686): Elementor\Frontend->handle_page_assets()
#18 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/enqueue.php(601): Elementor\Frontend->enqueue_styles()
#19 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): woodmart_enqueue_base_styles()
#20 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#21 /home4/vintekol/orberg.lv/wp-includes/plugin.php(517): WP_Hook->do_action()
#22 /home4/vintekol/orberg.lv/wp-includes/script-loader.php(2299): do_action()
#23 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts()
#24 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#25 /home4/vintekol/orberg.lv/wp-includes/plugin.php(517): WP_Hook->do_action()
#26 /home4/vintekol/orberg.lv/wp-includes/general-template.php(3192): do_action()
#27 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/header.php(12): wp_head()
#28 /home4/vintekol/orberg.lv/wp-includes/template.php(810): require_once('/home4/vintekol...')
#29 /home4/vintekol/orberg.lv/wp-includes/template.php(745): load_template()
#30 /home4/vintekol/orberg.lv/wp-includes/general-template.php(48): locate_template()
#31 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-layout-type.php(45): get_header()
#32 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-single-product.php(76): XTS\Modules\Layouts\Layout_Type->before_template_content()
#33 /home4/vintekol/orberg.lv/wp-content/themes/woodmart/inc/modules/layouts/class-single-product.php(64): XTS\Modules\Layouts\Single_Product->display_template()
#34 /home4/vintekol/orberg.lv/wp-includes/class-wp-hook.php(324): XTS\Modules\Layouts\Single_Product->override_template()
#35 /home4/vintekol/orberg.lv/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#36 /home4/vintekol/orberg.lv/wp-includes/template-loader.php(104): apply_filters()
#37 /home4/vintekol/orberg.lv/wp-blog-header.php(19): require_once('/home4/vintekol...')
#38 /home4/vintekol/orberg.lv/index.php(17): require('/home4/vintekol...')
#39 {main}
thrown in /home4/vintekol/orberg.lv/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/DataConvert.php on line 13

May 7, 2025 at 7:43 am #17004746

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you very much!

The most likely cause of this issue is that the _elementor_data field is null or contains invalid data. I kindly ask you to follow these steps and let me know the results:
- Edit the hidden link product using Elementor
- Make a small change in the content
- Save the changes and update the translation

Could you tell me if the issue disappeared?

May 7, 2025 at 7:57 am #17004825

marikaK

I updated content. Saved the changes. Cleared cache as well. Still the same problem. :/

And there is NO translation for products - so I can't update translation for product content. Website is just in one language. WPML is used just for string translation to Latvian (like Woocomerce Description -> Apraksts, Addidional information-> Tehniskie dati, HOME-> Sākums etc.)

And as I told before - if deactivate WPML String Translation plugin the problem is gone and everything works perfectly, but in this case all the strings are not translated - and it is not acceptable. This is the reason why I need WPML - to localize all page in Latvian.

May 7, 2025 at 8:10 am #17004877

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you for your message.

Although the problem disappears when the String Translation plugin is deactivated, the cause of the issue is not the String Translation plugin.

Can you share the access credentials to the site in your next message so I can take a closer look? I have set your next message private so you can share the credentials securely.

Confirm you have a full site backup that you can restore if necessary.

May 7, 2025 at 11:19 am #17005927

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you very much for sharing the credentials requested.

Before we continue, I kindly ask you to run the Woocommerce Multilingual wizard: hidden link and double-check if the issue has disappeared.

May 7, 2025 at 11:31 am #17006175

marikaK

Done!

And cleared cache as well. Still the same - issue hasn't disappeared.. :/

wizard-screenshot.JPG
May 7, 2025 at 11:49 am #17006262

Carlos Rojas
WPML Supporter since 03/2017

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Thank you!

I ran several troubleshooting steps, but the issue persists. Can you create a staging site with a copy of the live site where we can run further tests without affecting the live site?

You next message will be private so you can share the access credentials to the staging site securely.