• Resolved Fantou

    (@fantou)


    Hello

    On a stage site, I have a very weird issue : when I want to add or edit for example a post or a custom post type (with Crocoblockà or a content block (with Blocksy Theme) , I have this fatal error

    '
    
    Fatal error: Uncaught Error: array_filter(): Argument #1 ($array) must be of type array, null given
    in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php on line 310
    
    Pile d’appel :
    
    array_filter()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php:310
    Automattic\W\B\S\ShippingController::Automattic\W\B\S{closure}()
    array_map()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php:305
    Automattic\W\B\S\ShippingController::filter_shipping_packages()
    wp-includes/class-wp-hook.php:308
    WP_Hook::apply_filters()
    wp-includes/plugin.php:205
    apply_filters()
    wp-content/plugins/woocommerce/includes/class-wc-shipping.php:274
    WC_Shipping::calculate_shipping()
    wp-content/plugins/woocommerce/includes/class-wc-cart.php:1423
    WC_Cart::calculate_shipping()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php:42
    Automattic\W\S\U\CartController::calculate_totals()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Routes/V1/AbstractCartRoute.php:91
    Automattic\W\S\R\V\AbstractCartRoute::get_response()
    wp-includes/rest-api/class-wp-rest-server.php:1171
    WP_REST_Server::respond_to_request()
    wp-includes/rest-api/class-wp-rest-server.php:1018
    WP_REST_Server::dispatch()
    wp-includes/rest-api.php:535
    rest_do_request()
    wp-includes/rest-api.php:2884
    rest_preload_api_request()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php:325
    Automattic\W\B\A\AssetDataRegistry::hydrate_api_request()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php:40
    Automattic\W\B\B\AllProducts::hydrate_from_api()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php:33
    Automattic\W\B\B\AllProducts::enqueue_data()
    wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractBlock.php:100
    Automattic\W\B\B\AbstractBlock::enqueue_editor_assets()
    wp-includes/class-wp-hook.php:308
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:332
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-admin/edit-form-blocks.php:272
    require()
    wp-admin/post.php:187
    '

    It occurs with pHp 8.0. If I set pHp 7.4, no problem

    The stage site is placed on a subdomain

    Apart from that, WooCommerce seems to work well. This fatal error occurs in the backend

    I’ve disabled plugins and it is when WooCommerce is enabled that this issue occurs

    I don’t really understand why the “ShippingCOntroller” could be a problem in this situation

    Have you an idea to solve this issue?

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Support Paulo P – a11n

    (@paulostp)

    Hello @fantou,

    I’m closing this topic as the discussion has now moved to our premium support channel.

    Best,

    @paulostp I feel kind of left out :). I’m still experiencing the issue as described above. How can I hop in on the same support wagon? I’ve already spent ages in troubleshooting and supplying the info for support.

    Thread Starter Fantou

    (@fantou)

    Hi @italpasta ,

    For me the problem is when an article is adding in the cart. If I clean customer’s session, the problem is gone and as soon as I insert a product in the cart BOUM! the problem reappears. Is this the same thing for you?

    But the other thing is the problem is not always here. And when I’m sending the link to the support, they have no problem and they can create, modify, etc… article, page etc…. It’s very weird.

    When you contacted the support, did they have seen the problem on your site?

    Plugin Contributor Nadir Seghir a11n

    (@assassinateur)

    Hey!

    While I’m unable to reproduce, WooCommerce Blocks 9.7.0 had a code change that should fix this, can you test with it?

    Thread Starter Fantou

    (@fantou)

    Hi @assassinateur

    Thanks for the information. Seems working for me, hope it will last! ??

    And thank you for the fix! Will this code be integrated in WooCommerce core soon?

    @italpasta , is it working for you?

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @fantou, @italpasta

    We have an update from our developers – this issue will be fixed in WooCommerce 7.6 which is scheduled for April 11, 2023. (WooCommerce Blocks 9.7.0 containing this fix will be bundled into WooCommerce core plugin)

    For the time being, you can install the WooCommerce Blocks plugin to fix the fatal error.

    Once the fix is released in 7.6, you can uninstall the WooCommerce Blocks plugin.

    I hope this helps!

    Thread Starter Fantou

    (@fantou)

    Hi @kaushiksomaiya

    Ok, thanks for the information! It helps and thank you for your help on this issue ??

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Fatal Error when adding or editing post, CPT, custom blocks…’ is closed to new replies.