• 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 15 replies - 1 through 15 (of 22 total)
  • Hi @fantou

    Thanks for reaching out!

    I understand that you are receiving the error message above when your site is using PHP 8 and WooCommerce is enabled, correct?

    I’d like to understand your site properly, please share your System Status Report that you can find via WooCommerce > Status. Select Get system report and then Copy for support. Once you’ve done that, you can paste it into your reply here.

    If you could also provide the fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Thanks!

    Thread Starter Fantou

    (@fantou)

    Hi @xue28 , Thanks for your reply

    I understand that you are receiving the error message above when your site is using PHP 8 and WooCommerce is enabled, correct?

    Yes it is. But the problem occurs in the backend of WordPress, when I’m trying to edit or create posts, custom post type,…

    Here is the system report :

    '
    
    ### WordPress Environment ###
    
    WordPress address (URL): https://www.perlesetpierres.fantouwebmaster.com
    
    Site address (URL): https://www.perlesetpierres.fantouwebmaster.com
    
    WC Version: 7.4.0
    
    REST API Version: ✔</img> 7.4.0
    
    WC Blocks Version: ✔</img> 9.4.3
    
    Action Scheduler Version: ✔</img> 3.5.4
    
    Log Directory Writable: ✔</img>
    
    WP Version: 6.1.1
    
    WP Multisite: –
    
    WP Memory Limit: 2 Go
    
    WP Debug Mode: –
    
    WP Cron: ✔</img>
    
    Language: fr_FR
    
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    
    PHP Version: 8.0.27
    
    PHP Post Max Size: 512 Mo
    
    PHP Time Limit: 30
    
    PHP Max Input Vars: 1000
    
    cURL Version: 7.84.0
    
    OpenSSL/1.1.1p
    
    SUHOSIN Installed: –
    
    MySQL Version: 10.6.12-MariaDB
    
    Max Upload Size: 128 Mo
    
    Default Timezone is UTC: ✔</img>
    
    fsockopen/cURL: ✔</img>
    
    SoapClient: ✔</img>
    
    DOMDocument: ✔</img>
    
    GZip: ✔</img>
    
    Multibyte String: ✔</img>
    
    Remote Post: ✔</img>
    
    Remote Get: ✔</img>
    
    ### Database ###
    
    WC Database Version: 7.4.0
    
    WC Database Prefix: wc_85_
    
    Taille totale de la base de données: 140.71MB
    
    Taille de la base de données: 116.72MB
    
    Taille de l’index: 23.99MB
    
    wc_85_woocommerce_sessions: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_woocommerce_api_keys: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_woocommerce_attribute_taxonomies: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_woocommerce_downloadable_product_permissions: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
    
    wc_85_woocommerce_order_items: Données : 0.06MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_woocommerce_order_itemmeta: Données : 0.17MB + Index : 0.17MB + Moteur InnoDB
    
    wc_85_woocommerce_tax_rates: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
    
    wc_85_woocommerce_tax_rate_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_woocommerce_shipping_zones: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_woocommerce_shipping_zone_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_woocommerce_shipping_zone_methods: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_woocommerce_payment_tokens: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_woocommerce_payment_tokenmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_woocommerce_log: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_actionscheduler_actions: Données : 2.44MB + Index : 1.58MB + Moteur InnoDB
    
    wc_85_actionscheduler_claims: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_actionscheduler_groups: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_actionscheduler_logs: Données : 1.52MB + Index : 0.58MB + Moteur InnoDB
    
    wc_85_commentmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_comments: Données : 0.06MB + Index : 0.09MB + Moteur InnoDB
    
    wc_85_duplicator_pro_entities: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_duplicator_pro_packages: Données : 0.08MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_e_events: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_e_notes: Données : 0.02MB + Index : 0.17MB + Moteur InnoDB
    
    wc_85_e_notes_users_relations: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
    
    wc_85_e_submissions: Données : 0.02MB + Index : 0.27MB + Moteur InnoDB
    
    wc_85_e_submissions_actions_log: Données : 0.02MB + Index : 0.11MB + Moteur InnoDB
    
    wc_85_e_submissions_values: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_imagify_files: Données : 0.02MB + Index : 0.08MB + Moteur InnoDB
    
    wc_85_imagify_folders: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_jet_post_types: Données : 0.03MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_jet_rel_default: Données : 0.06MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_jet_smart_filters_indexer: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_jet_taxonomies: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_links: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_litespeed_avatar: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_litespeed_url: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_litespeed_url_file: Données : 0.02MB + Index : 0.08MB + Moteur InnoDB
    
    wc_85_options: Données : 9.02MB + Index : 0.19MB + Moteur InnoDB
    
    wc_85_postmeta: Données : 47.52MB + Index : 9.80MB + Moteur InnoDB
    
    wc_85_posts: Données : 44.50MB + Index : 1.50MB + Moteur InnoDB
    
    wc_85_seopress_significant_keywords: Données : 0.14MB + Index : 0.16MB + Moteur InnoDB
    
    wc_85_termmeta: Données : 5.52MB + Index : 5.02MB + Moteur InnoDB
    
    wc_85_terms: Données : 0.06MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_term_relationships: Données : 1.25MB + Index : 0.41MB + Moteur InnoDB
    
    wc_85_term_taxonomy: Données : 0.08MB + Index : 0.09MB + Moteur InnoDB
    
    wc_85_usermeta: Données : 0.27MB + Index : 0.30MB + Moteur InnoDB
    
    wc_85_users: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
    
    wc_85_vi_wbe_history: Données : 0.31MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_wc_admin_notes: Données : 0.05MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_wc_admin_note_actions: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_wc_category_lookup: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_wc_customer_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_wc_download_log: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_wc_order_coupon_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_wc_order_product_lookup: Données : 0.05MB + Index : 0.06MB + Moteur InnoDB
    
    wc_85_wc_order_stats: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
    
    wc_85_wc_order_tax_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
    
    wc_85_wc_product_attributes_lookup: Données : 1.17MB + Index : 1.48MB + Moteur InnoDB
    
    wc_85_wc_product_download_directories: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_wc_product_meta_lookup: Données : 1.50MB + Index : 0.84MB + Moteur InnoDB
    
    wc_85_wc_rate_limits: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_wc_reserved_stock: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
    
    wc_85_wc_tax_rate_classes: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    wc_85_wc_webhooks: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
    
    ### Post Type Counts ###
    
    attachment: 1427
    
    ct_content_block: 15
    
    custom_css: 1
    
    customize_changeset: 54
    
    elementor_font: 1
    
    elementor_library: 10
    
    jet-engine: 2
    
    jet-form-builder: 1
    
    jet-popup: 1
    
    jet-smart-filters: 7
    
    jet-woo-builder: 1
    
    nav_menu_item: 40
    
    page: 13
    
    pierre: 99
    
    post: 3
    
    product: 669
    
    product_variation: 3821
    
    revision: 3388
    
    shop_coupon: 21
    
    shop_order: 94
    
    wcpa_pt_forms: 1
    
    wp_global_styles: 2
    
    wptb-tables: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ✔</img>
    
    Hide errors from visitors: ✔</img>
    
    ### Active Plugins (35) ###
    
    Query Monitor: par John Blackbourn – 3.11.2
    
    Blocksy Companion (Premium): par CreativeThemes – 1.8.76
    
    Bulky - Bulk Edit Products for WooCommerce: par VillaTheme – 1.0.17
    
    Custom Taxonomy Order: par Marcel Pol – 3.4.4
    
    Duplicate Page: par mndpsingh287 – 4.5.1
    
    Duplicator Pro: par Snap Creek – 4.5.9.1
    
    Elementor Pro: par Elementor.com – 3.11.2
    
    Elementor: par Elementor.com – 3.11.2
    
    FG PrestaShop to WooCommerce Premium: par Frédéric GILLES – 4.30.0
    
    Freesoul Deactivate Plugins: par Jose Mortellaro – 1.9.5.2
    
    JetBlocks For Elementor: par Crocoblock – 1.3.5
    
    JetElements For Elementor: par Crocoblock – 2.6.9
    
    JetEngine: par Crocoblock – 3.1.2
    
    JetPopup: par Crocoblock – 2.0.0
    
    JetSearch: par Crocoblock – 3.0.3
    
    JetSmartFilters - Elementor Responsive: par Crocoblock – 1.0.0
    
    JetSmartFilters: par Crocoblock – 3.0.4
    
    JetTabs For Elementor: par Crocoblock – 2.1.21
    
    JetTricks: par Crocoblock – 1.4.3
    
    JetWooBuilder For Elementor: par Crocoblock – 2.1.4
    
    JetProductGallery: par Crocoblock – 2.1.11
    
    JetFormBuilder: par Crocoblock – 3.0.0.3
    
    JetGridBuilder: par Crocoblock – 1.1.2
    
    JetWooBuilder - Products Grid Load More: par Crocoblock – 1.2.0
    
    o2switch - WpTiger: par  – 10-11-22
    
    Temporaire Login Without Password: par StoreApps – 1.8.1.1
    
    Chronopost & Mondial relay pour WooCommerce - WCMultiShipping: par Mondial Relay WooCommerce - WCMultiShipping – 2.1.8
    
    WooCommerce Weight Based Shipping: par weightbasedshipping.com – 5.4.0
    
    WooCommerce Stripe Gateway: par WooCommerce – 7.1.0
    
    WooCommerce: par Automattic – 7.4.0
    
    WP Crontrol: par John Blackbourn & contributeurs – 1.15.1
    
    SEOPress PRO: par The SEO Guys at SEOPress – 6.4.0.1
    
    SEOPress: par The SEO Guys at SEOPress – 6.4.0.2
    
    WP Table Builder: par WP Table Builder – 1.4.8
    
    WPS Hide Login: par WPServeur
    
    NicolasKulka
    
    wpformation – 1.9.8
    
    ### Inactive Plugins (3) ###
    
    Imagify: par Imagify – Optimize Images & Convert WebP – 2.1.1
    
    LiteSpeed Cache: par LiteSpeed Technologies – 5.3.3
    
    WooCommerce Custom Product Addons (Free): par Acowebs – 2.7.5
    
    ### Dropin Plugins (1) ###
    
    db.php: Query Monitor Database Class (Drop-in)
    
    ### Must Use Plugins (1) ###
    
    freesoul deactivate plugins [fdp]: par Jose Mortellaro – 1.9.5.2
    
    ### Settings ###
    
    API Enabled: –
    
    Force SSL: –
    
    Currency: EUR (€)
    
    Currency Position: right
    
    Thousand Separator: .
    
    Decimal Separator: ,
    
    Number of Decimals: 2
    
    Taxonomies: Product Types: external (external)
    
    grouped (grouped)
    
    simple (simple)
    
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    
    exclude-from-search (exclude-from-search)
    
    featured (featured)
    
    outofstock (outofstock)
    
    rated-1 (rated-1)
    
    rated-2 (rated-2)
    
    rated-3 (rated-3)
    
    rated-4 (rated-4)
    
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    Enforce Approved Product Download Directories: ✔</img>
    
    Order datastore: WC_Order_Data_Store_CPT
    
    ### WC Pages ###
    
    Base de la boutique: #14 - /boutique/
    
    Panier: #15 - /panier/
    
    Commander: #16 - /commander/
    
    Mon compte: #17 - /mon-compte/
    
    Conditions générales de vente et d’utilisation: #7161 - /c-g-v/
    
    ### Theme ###
    
    Name: Blocksy Child
    
    Version: (une mise à jour de la version 0 est disponible)
    
    Author URL: 
    
    Child Theme: ✔</img>
    
    Parent Theme Name: Blocksy
    
    Parent Theme Version: 1.8.76
    
    Parent Theme Author URL: https://creativethemes.com
    
    WooCommerce Support: ✔</img>
    
    ### Templates ###
    
    Overrides: blocksy/woocommerce/cart/cart.php
    
    blocksy/woocommerce/cart/mini-cart.php
    
    blocksy/woocommerce/content-widget-product.php
    
    blocksy/woocommerce/content-widget-reviews.php
    
    blocksy/woocommerce/myaccount/my-account.php
    
    blocksy/woocommerce/product-searchform.php
    
    blocksy/woocommerce/single-product/tabs/tabs.php
    
    ### Admin ###
    
    Enabled Features: activity-panels
    
    analytics
    
    coupons
    
    customer-effort-score-tracks
    
    import-products-task
    
    experimental-fashion-sample-products
    
    shipping-smart-defaults
    
    shipping-setting-tour
    
    homescreen
    
    marketing
    
    multichannel-marketing
    
    mobile-app-banner
    
    navigation
    
    new-product-management-experience
    
    onboarding
    
    onboarding-tasks
    
    remote-inbox-notifications
    
    remote-free-extensions
    
    payment-gateway-suggestions
    
    shipping-label-banner
    
    subscriptions
    
    store-alerts
    
    transient-notices
    
    woo-mobile-welcome
    
    wc-pay-promotion
    
    wc-pay-welcome-page
    
    Disabled Features: minified-js
    
    product-variation-management
    
    settings
    
    Daily Cron: ✔</img> Next scheduled: 2023-02-26 09:55:05 +00:00
    
    Options: ✔</img>
    
    Notes: 38
    
    Onboarding: skipped
    
    ### Action Scheduler ###
    
    Terminé: 5 203
    
    Oldest: 2023-01-25 15:36:00 +0000
    
    Newest: 2023-02-25 14:11:32 +0000
    
    Échoué: 16
    
    Oldest: 2022-12-14 08:11:00 +0000
    
    Newest: 2023-02-24 23:27:36 +0000
    
    En attente: 1
    
    Oldest: 2023-02-26 14:11:32 +0000
    
    Newest: 2023-02-26 14:11:32 +0000
    
    ### Status report information ###
    
    Generated at: 2023-02-25 14:20:12 +00:00

    Here is the fatal error log :

    '
    
    2023-02-25T14:31:08+00:00 CRITICAL Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php:310
    
    Stack trace:
    
    #0 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php(310): array_filter()
    
    #1 [internal function]: Automattic\WooCommerce\Blocks\Shipping\ShippingController->Automattic\WooCommerce\Blocks\Shipping\{closure}()
    
    #2 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php(305): array_map()
    
    #3 /wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\Shipping\ShippingController->filter_shipping_packages()
    
    #4 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
    
    #5 /wp-content/plugins/woocommerce/includes/class-wc-shipping.php(274): apply_filters()
    
    #6 /wp-content/plugins/woocommerce/includes/class-wc-cart.php(1423): WC_Shipping->calculate_shipping()
    
    #7 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php(42): WC_Cart->calculate_shipping()
    
    #8 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Routes/V1/AbstractCartRoute.php(91): Automattic\WooCommerce\StoreApi\Utilities\CartController->calculate_totals()
    
    #9 /wp-includes/rest-api/class-wp-rest-server.php(1171): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractCartRoute->get_response()
    
    #10 /wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request()
    
    #11 /wp-includes/rest-api.php(535): WP_REST_Server->dispatch()
    
    #12 /wp-includes/rest-api.php(2884): rest_do_request()
    
    #13 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php(325): rest_preload_api_request()
    
    #14 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php(40): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->hydrate_api_request()
    
    #15 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php(33): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->hydrate_from_api()
    
    #16 /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractBlock.php(100): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->enqueue_data()
    
    #17 /wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets()
    
    #18 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    
    #19 /wp-includes/plugin.php(517): WP_Hook->do_action()
    
    #20 /wp-admin/edit-form-blocks.php(272): do_action()
    
    #21 /wp-admin/post.php(187): require('/home/sgyl2290/...')
    
    #22 {main}
    
      thrown dans /wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php à la ligne 310

    Thanks for your help!

    @xue28 , I’m experiencing the same issue which is outlined in an earlier thread. You will find the system information and logs there.

    @fantou , try switching to Classic Editor. For me the issue disappeared once I did it. However this isn’t a longterm solution.

    Thread Starter Fantou

    (@fantou)

    Hi @italpasta

    Thanks for the tip and the other related links! Its a very weird error…

    For the moment, I deactivate woocommerce on the “conflict pages” with this plugin : https://fr.ww.wp.xz.cn/plugins/freesoul-deactivate-plugins/

    Not really a longterm solution neither. Hope a real solution will be find but the problem seems to last since a while now…

    Hi, @italpasta

    I marked your own thread as not resolved, so that anyone will be able to chime in (including my colleagues).

    Hi, @fantou

    I understand you have disabled plugins already, to confirm, could you tell me if disabling all plugins except WooCommerce and switching temporarily the site’s theme to Storefront makes a difference?

    We recommend the Meks Quick Plugin Disabler, this plugin will remember what plugins you currently have active, so it’s easy to switch them back on.

    If the above does not help, please let me know if the error occurs any time when you edit the page or a post [Scenario A], or does it occur when you add any particular block/s or content on the pages [Scenario B]? (I have read it is present when using Crocoblock, so it’s B, but please clarify). And please send us a screenshot of the error on your end via https://snipboard.io for clarity.

    Thanks.

    • This reply was modified 3 years, 3 months ago by Igor H.
    Thread Starter Fantou

    (@fantou)

    Hi @ihereira , thanks for your reply

    I’ve tried again with all plugins deactivated except woocommerce and using storefront’s theme : same problem.

    It happens:
    >In this configuration (all plugins deactivated + storefront) :when I wish to add or modify an article (no problem with page)

    >With all plugins activated : Like before + when I wish to add or modify custom post type (using Crocoblock) + add or modify block contents (using Blocksy Theme)

    Sometimes, this error disappear and reappears later.
    For example : at this very moment, with all plugins deactivated+storefront : I switched several times from pHp 7.4 / 8.0 for testing and I had this error first but not anymore for the moment.
    Same thing with all plugins activated.

    An additional information : This staging site is on a subdomain.
    I’ve tried on a domain and it seems that I don’t have the issue.

    Here is the error :

    '
    Détails de l’erreur
    
    Une erreur de type E_ERROR a été causée dans la ligne 310 du fichier /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php. Message d’erreur : Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php:310
    Stack trace:
    
    0 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php(310): array_filter()
    
    1 [internal function]: Automattic\WooCommerce\Blocks\Shipping\ShippingController->Automattic\WooCommerce\Blocks\Shipping{closure}()
    
    2 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Shipping/ShippingController.php(305): array_map()
    
    3 /home/sitest.fantouwebmaster.com/wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\Shipping\ShippingController->filter_shipping_packages()
    
    4 /home/sitest.fantouwebmaster.com/wp-includes/plugin.php(205): WP_Hook->apply_filters()
    
    5 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/includes/class-wc-shipping.php(274): apply_filters()
    
    6 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/includes/class-wc-cart.php(1423): WC_Shipping->calculate_shipping()
    
    7 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php(42): WC_Cart->calculate_shipping()
    
    8 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/StoreApi/Routes/V1/AbstractCartRoute.php(91): Automattic\WooCommerce\StoreApi\Utilities\CartController->calculate_totals()
    
    9 /home/sitest.fantouwebmaster.com/wp-includes/rest-api/class-wp-rest-server.php(1171): Automattic\WooCommerce\StoreApi\Routes\V1\AbstractCartRoute->get_response()
    
    10 /home/sitest.fantouwebmaster.com/wp-includes/rest-api/class-wp-rest-server.php(1018): WP_REST_Server->respond_to_request()
    
    11 /home/sitest.fantouwebmaster.com/wp-includes/rest-api.php(535): WP_REST_Server->dispatch()
    
    12 /home/sitest.fantouwebmaster.com/wp-includes/rest-api.php(2884): rest_do_request()
    
    13 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Assets/AssetDataRegistry.php(325): rest_preload_api_request()
    
    14 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php(40): Automattic\WooCommerce\Blocks\Assets\AssetDataRegistry->hydrate_api_request()
    
    15 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AllProducts.php(33): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->hydrate_from_api()
    
    16 /home/sitest.fantouwebmaster.com/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/AbstractBlock.php(100): Automattic\WooCommerce\Blocks\BlockTypes\AllProducts->enqueue_data()
    
    17 /home/sitest.fantouwebmaster.com/wp-includes/class-wp-hook.php(308): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets()
    
    18 /home/sitest.fantouwebmaster.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    
    19 /home/sitest.fantouwebmaster.com/wp-includes/plugin.php(517): WP_Hook->do_action()
    
    20 /home/sitest.fantouwebmaster.com/wp-admin/edit-form-blocks.php(272): do_action()
    
    21 /home/sitest.fantouwebmaster.com/wp-admin/post.php(187): require('/home/…')
    
    22 {main}
    
    thrown

    Have a nice day

    • This reply was modified 3 years, 3 months ago by Fantou.
    • This reply was modified 3 years, 3 months ago by Fantou.

    @ihereira in my case the error happens when editing either a page or a post. Switching to storefront does not solve the issue.

    The error happens on 2 different sites. One one of them switching to classic editor seemed to help, but on the other it doesn’t. This has been happening for quite some time now and it should be escalated to the dev team.

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @fantou

    This appears to be related to WooCommerce Blocks library and specifically Local Pickup method.

    Could you share a few screenshots showing your Shipping settings?

    • Shipping Zones
    • Settings within each zone
    • WooCommerce > Settings > Shipping > Shipping Options
    Thread Starter Fantou

    (@fantou)

    Hello @kaushiksomaiya , Thanks for your reply

    Here are some requested’s screenshots:
    Shipping Zone:
    https://ibb.co/vL30Pcg

    Shipping Settings:
    https://ibb.co/4pMBCnd

    https://ibb.co/dLsPZsm

    Shipping Options:
    https://ibb.co/4tMR2VJ

    • This reply was modified 3 years, 3 months ago by Fantou.
    • This reply was modified 3 years, 3 months ago by Fantou.
    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there @fantou!

    Thanks for sharing the screenshots.

    Can you share the same screenshots after deactivating all plugins except WooCommerce and switching the theme to a default one like 2022?

    Can you also confirm if the error persists after you “Clear customer sessions” in WooCommerce > Status > Tools area?

    Thread Starter Fantou

    (@fantou)

    Hi @kaushiksomaiya , Thanks for your reply!

    Here are the screen requested after deactivated all plugins and switching to a default theme
    https://zupimages.net/up/23/10/tte3.jpg
    https://zupimages.net/up/23/10/rynz.jpg
    https://zupimages.net/up/23/10/60tv.jpg

    For the moment, the error is not here anymore after cleaning customer session.
    However, I already had this situation : the error “disappear” during a moment and then “reappear”.

    Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi @fantou

    I am unable to replicate this issue on my test site with the same shipping setup as yours.

    If you are able to replicate it again on a staging site with just WooCommerce as active and theme switched to Storefront/2022 – please submit a ticket here: https://woocommerce.com/my-account/create-a-ticket/ (You’ll need to create an account before you submit a ticket.)

    Be sure to mention this thread link in your request.

    Thread Starter Fantou

    (@fantou)

    Hi @kaushiksomaiya

    Ok I will do like you say, I have the error with all plugin deactivated except WooCommerce and StoreFront for theme.

    Thanks for your help and your time.

    Thread Starter Fantou

    (@fantou)

    Hi @kaushiksomaiya

    So I opened a ticket (#6035250) like I have this issue again with only WooCommerce and Storefront activated.

    Thanks for your help and your time.

Viewing 15 replies - 1 through 15 (of 22 total)

The topic ‘Fatal Error when adding or editing post, CPT, custom blocks…’ is closed to new replies.