• Resolved Jose

    (@giuse)


    Hello

    PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in …/plugins/wp-content/plugins/woocommerce/includes/wc-cart-functions.php:476

    This fatal error is triggered in the backend when I try to create a new page.
    First of all, why does the code in wc-cart-functions.php run when I try to create a new page? The cart has nothing to do with creating a new page in the backend, so please, don’t slow down the entire backend for anything.

    Apart from that, on line 476 you have

    $new_rates = array_keys( $package['rates'] );

    I would first check that $package[‘rates’] is set and that it’s an array before applying array_keys.

    This was for your information. I hadn’t time to investigate deeper, and I can’t tell you why it happens, or which plugin give conflicts…, And I will not have the time to investigate deeper. In my case; I solved it in another way, and if you want you can also close this thread. This was for your information. Be aware, that under some conditions WooCommerce triggers that fatal error when you create a new page.

    Best regards

    Jose

Viewing 1 replies (of 1 total)
  • Saif

    (@babylon1999)

    Hello @giuse,

    Thank you for sharing all this valuable information.

    time to investigate deeper. In my case; I solved it in another way, and if you want you can also close this thread. This was for your information. Be aware, that under some conditions WooCommerce triggers that fatal error when you

    First, I’m glad to hear you’ve figured it out. I’m not sure why part of WooCommerce is running when creating a new page, but if you think something could be done better you can make a pull request on Github. ??

    I will go ahead and close the thread, feel free to open a new one if you have any other questions.

    Thanks again!

Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error on new page’ is closed to new replies.