• Resolved daneshh

    (@daneshh)


    Hello,

    when I want to save a product this plugin makes a fatal error. (the product has variations)

    Debug.log :

    [21-Nov-2023 10:49:35 UTC] PHP Fatal error: Uncaught Error: Call to a member function update_meta_data() on bool in /var/www/html/wordpress/wp-content/plugins/license-manager-for-woocommerce/includes/Integrations/WooCommerce/ProductData.php:229
    Stack trace:
    
    0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(326): LicenseManagerForWooCommerce\Integrations\WooCommerce\ProductData->savePost()
    
    1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    
    2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    
    3 /var/www/html/wordpress/wp-includes/post.php(4760): do_action()
    
    4 /var/www/html/wordpress/wp-includes/revision.php(380): wp_insert_post()
    
    5 /var/www/html/wordpress/wp-includes/revision.php(217): _wp_put_post_revision()
    
    6 /var/www/html/wordpress/wp-includes/revision.php(116): wp_save_post_revision()
    
    7 /var/www/html/wordpress/wp-includes/class-wp-hook.php(326): wp_save_post_revision_on_insert()
    
    8 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    
    9 /var/www/h in /var/www/html/wordpress/wp-content/plugins/license-manager-for-woocommerce/includes/Integrations/WooCommerce/ProductData.php on line 229

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @daneshh,

    Thanks for contacting us,

    Hope you are doing well, We’ve informed our technical team about your issue, and they will work on it promptly. When we receive their response, we will get back to you. Our team is here to assist you.

    Thanks & Regards
    WP Experts Support Team

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @daneshh,

    You have to go to this file. Here is the file path wp-content\plugins\license-manager-for-woocommerce\includes\Integrations\WooCommerce\ProductData.php and then add this code in the savePost function.

    Here is the code:

     if ( ! is_object( $product ) ) {
            return;
      }

    Please check it and let me know if you still have any issues.

    Thank you

    Thread Starter daneshh

    (@daneshh)

    Hi.

    thanks for checking.

    should I add the if condition at the beginning of the savePost function?

    like this ?

    public function savePost($postId)
        {
            if ( ! is_object( $product ) ) {
                return;
            }
            // This is not a product.
            if (!array_key_exists('post_type', $_POST)
    ...
    Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @daneshh,

    To escalate your case, please create a ticket on our official website so that we can connect you directly with our Technical team.

    Looking forward to getting your issue resolved.

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal PHP error’ is closed to new replies.