• Resolved Sudhanshu Dubey

    (@sudhanshudubey)


    Hello,

    Here you can see the log I have found in woocommerce log. Its a fatal error on my website:

    2025-03-07T14:12:49+00:00 Critical Uncaught TypeError: Argument 1 passed to Automattic\WooCommerce\Utilities\OrderUtil::get_post_or_object_meta() must be an instance of WP_Post or null, instance of stdClass given, called in /nas/content/live/fmperspective/wp-content/plugins/woocommerce/includes/admin/wc-meta-box-functions.php on line 156 and defined in /nas/content/live/fmperspective/wp-content/plugins/woocommerce/src/Utilities/OrderUtil.php:58 Stack trace: #0 /nas/content/live/fmperspective/wp-content/plugins/woocommerce/includes/admin/wc-meta-box-functions.php(156): Automattic\WooCommerce\Utilities\OrderUtil::get_post_or_object_meta(Object(stdClass), NULL, ‘slicewp_disable…’, true) #1 /nas/content/live/fmperspective/wp-content/plugins/slicewp/includes/base/integrations/woocommerce/functions-hooks-integration-woocommerce.php(676): woocommerce_wp_checkbox(Array) #2 /nas/content/live/fmperspective/wp-includes/class-wp-hook.php(324): slicewp_add_product_commission_settings_woo(”) #3 /nas/content/live/fmperspective/wp-includes/class-wp-hook.ph in /nas/content/live/fmperspective/wp-content/plugins/woocommerce/src/Utilities/OrderUtil.php on line 58

    Please fix it. I am using the very latest version of WooCommerce.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @sudhanshudubey,

    Thank you for reaching out and for sharing this error! I’m afraid that I was not able to replicate this particular error. Also, I’ve searched our support system and we have yet to receive such an error report.

    Even so, I have investigated the error stack trace and, even though SliceWP shows up in the error, the error does not trigger within SliceWP. It’s triggered within WooCommerce.

    Even so, looking at WooCommerce’s code, the issue should also not be from WooCommerce itself.

    To be more specific, within SliceWP, we’re calling WooCommerce’s “woocommerce_wp_checkbox” function to output the checkbox for disabling commissions. Within “woocommerce_wp_checkbox” WooCommerce is using the global $post object. This object, normally, should be set as a WP_Post type object. On your website it’s set to stdClass. Why this is, I cannot say.

    I know the above details are technical, but I wanted to share the behind the scenes.

    What I recommend is for you to disable all active WordPress plugins, besides SliceWP and WooCommerce. Then, navigate to a product’s edit page. This is where the error originates from.

    My assumption is that, with all other plugins disabled, the error will not show up again.

    If you then activate each plugin, one by one, and navigate to the product’s edit page, to try and trigger the error, the error should appear after activating one of the plugins. If this is the case, you will find the plugin causing the issue.

    Thank you and best wishes,

    Mihai

Viewing 1 replies (of 1 total)

The topic ‘Fatal error is coming up’ is closed to new replies.