• Resolved Andy Rachmiel

    (@arachmiel)


    When I go to create a new post on my website after activating the WP Crowdfunding plugin, I get an error.
    
    2023-07-07T12:54:32+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /bitnami/wordpress/wp-content/plugins/wp-crowdfunding/includes/woocommerce/Woocommerce.php:112
    Stack trace: 0 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(308): WPCF\woocommerce\Woocommerce->override_checkout_fields() 1 /opt/bitnami/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters() 2 /bitnami/wordpress/wp-content/plugins/woocommerce/includes/class-wc-checkout.php(300): apply_filters() 3 /bitnami/wordpress/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-upe-checkout.php(169): WC_Checkout->get_checkout_fields() 4 /bitnami/wordpress/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-blocks-payment-method.php(100): WCPay\WC_Payments_UPE_Checkout->get_payment_fields_js_config() 5 /bitnami/wordpress/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Payments/PaymentMethodRegistry.php(62): WC_Payments_Blocks_Payment_Method->get_payment_method_data() 6 /bitnami/wordpress/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Payments/Api.php(93): Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry->get_all_registered_script_data() 7 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\Payments\Api->add_payment_method_script_data() 8 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 9 /opt/bitnami/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action() 10 /bitnami/wordpress/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/MiniCart.php(204): do_action() 11 /bitnami/wordpress/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractBlock.php(100): Automattic\WooCommerce\Blocks\BlockTypes\MiniCart->enqueue_data() 12 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets() 13 /opt/bitnami/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 14 /opt/bitnami/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action() 15 /opt/bitnami/wordpress/wp-admin/edit-form-blocks.php(272): do_action() 16 /opt/bitnami/wordpress/wp-admin/post-new.php(72): require('…') 17 {main} thrown in /bitnami/wordpress/wp-content/plugins/wp-crowdfunding/includes/woocommerce/Woocommerce.php on line 112 If I disable the plugin I can create a post.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Dear @arachmiel

    We apologize for the issue you’re experiencing. It appears to be a website-specific problem and to properly diagnose and resolve it, we would need to thoroughly inspect your website. Please reach out to us at?https://www.themeum.com/support/?for assistance.

    We have this same error and it looks like a bug in the code.

    Line 112 Woocommerce.php : Checking on empty cart

    if(! WC()->cart && WC()->cart->is_empty()) {
    This checks to see if the cart doesn’t exist AND checks to see if the cart has the is_empty function. If the cart does not exist (is null), then it should not look at the next comparison.

    if(! WC()->cart || WC()->cart->is_empty()) {
    IF the cart does not exist it falls through as an empty card or if it does exists and is_empty() it also falls through.

    This fixes the error. If you all can verify it would be appreciated.


    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Dear @sashman13

    We apologize for the issue you’re experiencing. It appears to be a website-specific problem and to properly diagnose and resolve it, we would need to thoroughly inspect your website. Please reach out to us at?https://www.themeum.com/support/?for assistance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘CRITICAL Uncaught Error: Call to a member function get_cart() on null’ is closed to new replies.