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 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

This topic contains 10 replies, has 2 voices.

Last updated by Bigul 11 months, 3 weeks ago.

Assisted by: Bigul.

Author Posts
April 25, 2023 at 4:18 pm #13535113

marcM-23

When I updated a product in WooCommerce, I get a fatal error. When adding these 2 lines (see attached image to the plugin), the error is gone.

2023/04/20 20:35:39 [error] 44161#44161: *18901 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_id() on bool in /www/omjuicersch_501/public/wp-content/plugins/woocommerce/includes/class-wc-comments.php:447

Stack trace:

#0 /www/omjuicersch_501/public/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-comments.php(112): WC_Comments::get_rating_counts_for_product(false)

#1 [internal function]: WCML_Comments->recalculate_comment_rating(32775)

#2 /www/omjuicersch_501/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(371): call_user_func_array(Array, Array)

#3 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(310): WPML\FP\Fns::WPML\FP\{closure}(32775)

#4 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)

#5 /www/omjuicersch_501/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

#6 /www/omjuicersch_501/public/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php(759): do_action('woocom" while reading response header from upstream, client: 213.55.227.45, server: omjuicers.ch, request: "POST /wp-admin/post.php HTTP/1.1", upstream: "hidden link:", host: "omjuicers.ch:49792", referrer: hidden link

Screenshot 2023-04-22 at 11.56.01.png
April 26, 2023 at 4:18 pm #13543397

Bigul
Supporter

Languages: English (English )

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

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

This may be a compatibility issue. Please share the following details for tracking this.

1) Does it happens with multiple products

2) Is it happened after upgrading to the latest version of WooCommerce or WPML

3) Are you facing the same issue in other subsites of this Multisite installation

4) Do you have staging/dev site(A clone copy of the live site)

--
Thanks!

Bigul

April 29, 2023 at 12:16 pm #13561115

marcM-23

Hi Bigul,

Thanks for your response. Somehow, I didn't get an email notification of your answer. Can you please look at why that is so?

1) Yes, it happens on all products
2) Maybe, but I did many things at one, so I don't know.
3) I only have one multisite installation
4) Yes I have a staging site where I commented out those lines in the plugin that fix the issue. I would be very happy to give you access to it. I just tried to update 2 different products on that staging site and got the error twice with 2 slightly different messages in the log:

Product 1:

2023/04/29 12:09:34 [error] 66419#66419: *581 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key "sku" in /www/omjuicersch_501/public/wp-content/plugins/rudr-simple-multisite-crosspost/rudr-simple-multisite-crosspost.php on line 1466PHP message: PHP Warning: Undefined array key "blog_id" in /www/omjuicersch_501/public/wp-content/plugins/rudr-simple-multisite-crosspost/rudr-simple-multisite-crosspost.php on line 1295PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_stock_managed_by_id() on bool in /www/omjuicersch_501/public/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php:383
Stack trace:
#0 /www/omjuicersch_501/public/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php(366): WCML_Synchronize_Product_Data->update_stock_value(false, 10)
#1 /www/omjuicersch_501/public/wp-content/plugins/woocommerce-multilingual/inc/translation-editor/class-wcml-synchronize-product-data.php(409): WCML_Synchronize_Product_Data->sync_product_stock(Object(WC_Product_Variation))
#2 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(308): WCML_Synchronize_Product_Data->sync_product_stock_hook(Object(WC_Product_Variation))
#3 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#4 /www/omjuicersch_501/public/wp-includes/plugin.php(517): WP_Hoo" while reading response header from upstream, client: 2a02:aa13:8142:4300:48f9:a9a9:e2ec:4e52, server: stg-omjuicersch-staging.kinsta.cloud, request: "POST /wp-admin/post.php HTTP/1.1", upstream: "<em><u>hidden link</u></em>:", host: "stg-omjuicersch-staging.kinsta.cloud:21738", referrer: "<em><u>hidden link</u></em>"

Product 2:

2023/04/29 12:10:06 [error] 66415#66415: *722 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_id() on bool in /www/omjuicersch_501/public/wp-content/plugins/woocommerce/includes/class-wc-comments.php:447
Stack trace:
#0 /www/omjuicersch_501/public/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-comments.php(115): WC_Comments::get_rating_counts_for_product(false)
#1 [internal function]: WCML_Comments->recalculate_comment_rating(32770)
#2 /www/omjuicersch_501/public/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(371): call_user_func_array(Array, Array)
#3 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(310): WPML\FP\Fns::WPML\FP\{closure}(32770)
#4 /www/omjuicersch_501/public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#5 /www/omjuicersch_501/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /www/omjuicersch_501/public/wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php(759): do_action('woocom" while reading response header from upstream, client: 2a02:aa13:8142:4300:48f9:a9a9:e2ec:4e52, server: stg-omjuicersch-staging.kinsta.cloud, request: "POST /wp-admin/post.php HTTP/1.1", upstream: "<em><u>hidden link</u></em>:", host: "stg-omjuicersch-staging.kinsta.cloud:21738", referrer: "<em><u>hidden link</u></em>"

But then I'm providing you with a solution to the problem, so I'm not sure how much troubleshooting you need to do. What I need you to do is to implement this fix or another version of the fix in your next update so I don't need to keep fixing the plugin.

Thanks,
Marc

April 30, 2023 at 6:24 am #13561939

Bigul
Supporter

Languages: English (English )

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

Hi Marc,

Thank you for the details. This looks like a compatibility issue. So we would like to make the issue is existing in a minimal setup or not. Please do the following steps on the staging site and make sure the bug remains or not.

a) Backup your site first[Mandatory]
b) Make sure you have the latest version of WooCommerce and WPML
c) Switch for a moment to a WordPress default theme like 2022
d) Deactivate all the plugins that are not related to WPML except WooCommerce
e) Then check whether the issue is existing or not
f) If the issue is gone, activate the plugins as a group of three or four to find which one has an interaction issue
g) Switch back to the original theme of the site

--
Thanks!

Bigul

April 30, 2023 at 8:52 am #13562239

marcM-23

Hi Bigul,

Indeed it's a compatibility issue. It's the developer of a the plugin "Simple Multisite Crossposting" (hidden link) who suggested to add those lines to your code to fix this error.

So when I diable this plugins and its two add-ons, the issue disappears. The author of the plugin is claiming that the error comes from your plugin (which indeed it does, looking at the error message) and came up with a suggestion of how to fix it.

Best,
Marc

May 2, 2023 at 7:36 am #13567437

Bigul
Supporter

Languages: English (English )

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

Hi Marc,

Thank you for the feedback. For your kind information, this *Simple Multisite Crossposting* plugin is not included on the WPML official compatibility list for the Plugins - https://wpml.org/plugin/. It does not mean that this plugin is not compatible with WPML, but our compatibility team has not tested it yet.

So a couple of requests to track this.

1) Please fill the private details fields after a full site backup{mandatory}. I would like to access the admin area of your staging site for further checking. Refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

2) Please allow me to make a duplicator copy of your site using the Duplicator plugin(https://wordpress.org/plugins/duplicator/) for debugging the issue on my local server. So we can troubleshoot the issue without affecting your live site.

--
Thanks!

Bigul

May 3, 2023 at 2:44 pm #13579755

Bigul
Supporter

Languages: English (English )

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

Hi Marc,

Thank you for the details and login information. I have migrated your site to our Cloudways server. Because the duplicator and All In One Migration plugins are banned in Kinsta. Please check the following article for more details.

hidden link

We will debug the issue further and get back to you soon. Please wait.

--
Thanks!

Bigul

May 3, 2023 at 3:08 pm #13579943

marcM-23

Hi Bigul,
Sure, no problem that you duplicated it.
Keep me posted.
Best,
Marc

May 5, 2023 at 3:34 pm #13595521

Bigul
Supporter

Languages: English (English )

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

Hi Marc,

The issue is existing in my local copy after the initial checks. So consulting with our team for an expert opinion now. We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

May 5, 2023 at 5:19 pm #13596159

marcM-23

Hi Bigul,

Ok thanks for the update.

Best,
Marc

May 9, 2023 at 3:39 pm #13615415

Bigul
Supporter

Languages: English (English )

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

Hi Marc,

Please check my last message. It is marked as private. I have created a test space in Cloudways for debugging and tracing the issue. Reproducing the bug in a clean installation will help us a lot in debugging. Thank you for your understanding.

--
Thanks!

Bigul

The topic ‘[Closed] Missing 2 lines in WooCommerce Multilingual plugin’ is closed to new replies.