Fatal Error in version 3.1.7
-
Hi, I’ve noticed a recurring fatal error in version 3.1.7 of this plugin.
In the log it points to a line that runs $object->is_virtual() and that method doesn’t exist, since $object contains the value false according to the log and also it can be set to the value null, I’ve read in the code.
For now I’ve done a quick and dirty repair by first checking if the is_virtual() method is_callable, but probably it needs some more attention to find out if that is enough and spread the fix. This condition right now will crash the code.
if ( is_callable( array( $product, 'is_virtual' ) ) && ! $product->is_virtual() ) { $virtual = false; break; } $virtual = true;
Our websites run on php v8.3.x, so I don’t know if that version is more critical, but this error seems new.
I found this error when a subscription payment wasn’t able to register. We use the WC Subscriptions plugin too.
Thanks, Hans
The php error log says…
[29-Dec-2023 18:47:30 Asia/Dhaka] PHP Fatal error: Uncaught Error: Call to a member function is_virtual() on false in /wp-content/plugins/autocomplete-woocommerce-orders/lib/backend/class-settings.php:161 Stack trace: #0 /wp-includes/class-wp-hook.php(326): QuadLayers\ACO\Backend\Settings->autocomplete_orders() #1 /wp-includes/plugin.php(205): WP_Hook->apply_filters() #2 /wp-content/plugins/woocommerce/includes/class-wc-order.php(323): apply_filters() #3 /wp-content/plugins/woocommerce/includes/class-wc-order.php(300): WC_Order->maybe_set_date_paid() #4 /wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-data.php(713): WC_Order->set_status() #5 /wp-includes/class-wp-hook.php(326): WC_Meta_Box_Order_Data::save() #6 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #7 /wp-includes/plugin.php(517): WP_Hook->do_action() #8 /wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(263): do_action() #9 /wp-includes/class-wp-hook.php(326): WC_Admin_Meta_Boxes->save_meta_boxes() #10 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /wp-includes/plugin.php(517): WP_Hook->do_action() #12 /wp-includes/post.php(4760): do_action() #13 /wp-includes/post.php(4862): wp_insert_post() #14 /wp-admin/includes/post.php(453): wp_update_post() #15 /wp-admin/post.php(227): edit_post() #16 {main} thrown in /wp-content/plugins/autocomplete-woocommerce-orders/lib/backend/class-settings.php on line 161
- The topic ‘Fatal Error in version 3.1.7’ is closed to new replies.