• Resolved Alcegraphics

    (@alcegraphics)


    Hello there, I have the plugin causing a fatale error, in conflict with woocommerce.

    I have rolled back the plugin 3-4 versions ago but it still occurs.

    I have changed theme, deactivated plugins and changed the php version, but the problem remains

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dan

    (@dangoodman)

    Does it happen at the plugin activation?

    Could you share the entire error message and stack trace?

    Thread Starter Alcegraphics

    (@alcegraphics)

    Hello there, sorry for the late answer.
    I have debugged the problem and there is a conflict between your plugin and the plugin B2B WooCommerce
    https://woocommerce-b2b.com/

    Here is the stack trace, sorry but it is in italian:

    Dettagli dell’errore
    ====================
    Un errore di E_ERROR è stato causato nella linea 256 del file
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/ShippingMethod.php.
    Messaggio di errore: Uncaught TypeError:
    Wbs\ShippingMethod::Wbs\{closure}(): Argument #1 ($term) must be of type
    WP_Term, stdClass given in
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/ShippingMethod.php:256
    Stack trace:
    #0 [internal function]: Wbs\ShippingMethod::Wbs\{closure}(Object(stdClass))
    #1
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/vendor/dangoodman/arrays/Arrays.php(22):
    call_user_func(Object(Closure), Object(stdClass))
    #2
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/ShippingMethod.php(256):
    WbsVendors\Dgm\Arrays\Arrays::map(Array, Object(Closure))
    #3
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/ShippingMethod.php(182):
    Wbs\ShippingMethod::getAllShippingClasses()
    #4 [internal function]: Wbs\ShippingMethod->_enqueueAssets()
    #5
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/WpTools.php(30):
    call_user_func(Array)
    #6
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/weight-based-shipping-for-woocommerce/server/src/ShippingMethod.php(101):
    Wbs\WpTools::addActionOrCall(‘admin_enqueue_s…’, Array, 9223372036854775807)
    #7
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/woocommerce/includes/admin/settings/class-wc-settings-shipping.php(188):
    Wbs\ShippingMethod->admin_options()
    #8
    /home/customer/www/puliziapro.it/public_html/wp-includes/class-wp-hook.php(324):
    WC_Settings_Shipping->output(”)
    #9
    /home/customer/www/puliziapro.it/public_html/wp-includes/class-wp-hook.php(348):
    WP_Hook->apply_filters(”, Array)
    #10
    /home/customer/www/puliziapro.it/public_html/wp-includes/plugin.php(517):
    WP_Hook->do_action(Array)
    #11
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/woocommerce/includes/admin/views/html-admin-settings.php(40):
    do_action(‘woocommerce_set…’)
    #12
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-settings.php(153):
    include(‘/home/customer/…’)
    #13
    /home/customer/www/puliziapro.it/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(350):
    WC_Admin_Settings::output()
    #14
    /home/customer/www/puliziapro.it/public_html/wp-includes/class-wp-hook.php(324):
    WC_Admin_Menus->settings_page(”)
    #15
    /home/customer/www/puliziapro.it/public_html/wp-includes/class-wp-hook.php(348):
    WP_Hook->apply_filters(”, Array)
    #16
    /home/customer/www/puliziapro.it/public_html/wp-includes/plugin.php(517):
    WP_Hook->do_action(Array)
    #17
    /home/customer/www/puliziapro.it/public_html/wp-admin/admin.php(259):
    do_action(‘woocommerce_pag…’)
    #18 {main}
    thrown

    Plugin Author Dan

    (@dangoodman)

    Thank you for the details.

    Error: Argument #1 ($term) must be of type WP_Term, stdClass given
    Problematic code:

    array_map(function(WP_Term $term) {
        // ...
    }, WC()->shipping()->get_shipping_classes())
    

    WC()->shipping()->get_shipping_classes() must return an array of WP_Term instances. However, in your case, it is affected by third-party code, making it return an array of stdClass, which is not correct.

    Please contact B2B WooCommerce support to fix the plugin. Make sure to provide them with a link to this thread.

    Thread Starter Alcegraphics

    (@alcegraphics)

    Thanks, I try to reach them

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