• Resolved barnabas1

    (@barnabas1)


    Hello,

    When I change the order status to completed I get a fatal error and with many consequences of other hooks not triggering. Can you help me with this error log?

    2024-04-30T16:47:27+00:00 Critical Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /bitnami/wordpress/wp-content/plugins/woocommerce/includes/wc-product-functions.php:1013 CONTEXT: {"error":{"type":1,"file":"\/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/wc-product-functions.php","line":1013},"backtrace":["","#0 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/wc-product-functions.php(1013): array_map()","#1 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-orders.php(1031): wc_get_price_including_tax()","#2 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-orders.php(211): Woo_Invoice_Pro_Orders->get_regular_price_with_tax()","#3 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-orders.php(85): Woo_Invoice_Pro_Orders->get_order_items()","#4 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-orders.php(1777): Woo_Invoice_Pro_Orders->get_orders_info()","#5 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-template.php(139): woo_invoice_pro_orders()","#6 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-engine.php(1143): Woo_Invoice_Pro_Template->get_invoice_template()","#7 \/bitnami\/wordpress\/wp-content\/plugins\/webappick-pdf-invoice-for-woocommerce-pro\/includes\/class-woo-invoice-pro-hooks.php(1304): Woo_Invoice_Pro_Engine->savePdf()","#8 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(324): Woo_Invoice_Pro_Hooks->attach_invoice_to_order_email()","#9 \/opt\/bitnami\/wordpress\/wp-includes\/plugin.php(205): WP_Hook->apply_filters()","#10 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/emails\/class-wc-email.php(477): apply_filters()","#11 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/emails\/class-wc-email-customer-completed-order.php(69): WC_Email->get_attachments()","#12 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(326): WC_Email_Customer_Completed_Order->trigger()","#13 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#14 \/opt\/bitnami\/wordpress\/wp-includes\/plugin.php(565): WP_Hook->do_action()","#15 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/class-wc-emails.php(172): do_action_ref_array()","#16 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(324): WC_Emails::send_transactional_email()","#17 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#18 \/opt\/bitnami\/wordpress\/wp-includes\/plugin.php(517): WP_Hook->do_action()","#19 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/class-wc-order.php(411): do_action()","#20 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/class-wc-order.php(253): WC_Order->status_transition()","#21 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/includes\/admin\/meta-boxes\/class-wc-meta-box-order-data.php(768): WC_Order->save()","#22 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(326): WC_Meta_Box_Order_Data::save()","#23 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#24 \/opt\/bitnami\/wordpress\/wp-includes\/plugin.php(517): WP_Hook->do_action()","#25 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Admin\/Orders\/Edit.php(313): do_action()","#26 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Admin\/Orders\/Edit.php(153): Automattic\\WooCommerce\\Internal\\Admin\\Orders\\Edit->handle_order_update()","#27 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Admin\/Orders\/PageController.php(350): Automattic\\WooCommerce\\Internal\\Admin\\Orders\\Edit->setup()","#28 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Admin\/Orders\/PageController.php(366): Automattic\\WooCommerce\\Internal\\Admin\\Orders\\PageController->prepare_order_edit_form()","#29 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Admin\/Orders\/PageController.php(167): Automattic\\WooCommerce\\Internal\\Admin\\Orders\\PageController->setup_action_edit_order()","#30 [internal function]: Automattic\\WooCommerce\\Internal\\Admin\\Orders\\PageController->handle_load_page_action()","#31 \/bitnami\/wordpress\/wp-content\/plugins\/woocommerce\/src\/Internal\/Traits\/AccessiblePrivateMethods.php(158): call_user_func_array()","#32 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(324): Automattic\\WooCommerce\\Internal\\Admin\\Orders\\PageController->__call()","#33 \/opt\/bitnami\/wordpress\/wp-includes\/class-wp-hook.php(348): WP_Hook->apply_filters()","#34 \/opt\/bitnami\/wordpress\/wp-includes\/plugin.php(517): WP_Hook->do_action()","#35 \/opt\/bitnami\/wordpress\/wp-admin\/admin.php(237): do_action()","#36 {main}","thrown"]}

Viewing 9 replies - 1 through 9 (of 9 total)
  • This app seems or appears to be causing the issue. Please deactivate it and test.

    Thread Starter barnabas1

    (@barnabas1)

    Hello Stef,

    I deactivated the plugin and now instead of a 500 error I get an 502 error:

    502 Bad Gateway nginx

    On an Apache server – staging enviroment with the exact replica of the site I don’t get any errors when changing the order status to completed. I’m wondering what could be wrong here with the Nginx server…

    Wowza, that’s not good. You refreshed the page? Cleared cache after deactivating?

    Thread Starter barnabas1

    (@barnabas1)

    Thanks for the tip, indeed clearing cache fixed it. I didn’t expect that it would!

    So it’s the plugin the problem, isn’t it?

    Yes, since you are using a paid pro app you need to seek support from them. This forum is only for WooCommerce core. If you have an older version of their app, just put it back. If you have a backup you can grab it from. So on.

    Thread Starter barnabas1

    (@barnabas1)

    Thank you Stef, I’ll reach out to them.

    Thanks for the help.

    Sure thing. Let us know.

    Thread Starter barnabas1

    (@barnabas1)

    In the end the problem was a snippet that was running in the admin area, where I should have had a check to return if is admin.

    Oh those little snippets. Shame on them. Thanks for letting us know ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Error when changing order status to completed’ is closed to new replies.