Getting PHP errors “get_cart_contents() on null” in admin
-
If I have both Polylang and WooCommerce Checkout Manager (and WooCommerce, no other plugins) installed, I get four PHP error messages in the error log every time I open the product list in Admin (and on some other pages as well, e.g. Product editing page) like this one:
PHP Fatal error: Uncaught Error: Call to a member function get_cart_contents() on null in /home/shoppingt/wp-content/plugins/woocommerce-checkout-manager/lib/view/frontend/class-fields-disable.php:157 Stack trace: #0 /home/shoppingt/wp-includes/class-wp-hook.php(310): QuadLayers\WOOCCM\View\Frontend\Fields_Disable->disable_by_product() #1 /home/shoppingt/wp-includes/plugin.php(205): WP_Hook->apply_filters() #2 /home/shoppingt/wp-content/plugins/woocommerce-checkout-manager/lib/model/class-field.php(285): apply_filters() #3 /home/shoppingt/wp-content/plugins/woocommerce-checkout-manager/lib/view/frontend/class-fields-i18n.php(24): QuadLayers\WOOCCM\Model\Field->get_fields() #4 /home/shoppingt/wp-includes/class-wp-hook.php(308): QuadLayers\WOOCCM\View\Frontend\Fields_I18n->init_polylang() #5 /home/shoppingt/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #6 /home/shoppingt/wp-includes/plugin.php(517): WP_Hook->do_action() #7 /home/shoppingt/wp-settings.php(617): do_action() #8 /home/shoppingt/wp-config.php(112): require_once('/home/shoppingt...') #9 /home/shoppingt/wp-load.php(50): require_once('/home/shoppingt...') #10 /home/shoppingt/wp-blog-header.php(13): require_once('/home/shoppingt...') #11 /home/shoppingt/index.php(17): require('/home/shoppingt...') #12 {main} thrown in /home/shoppingt/wp-content/plugins/woocommerce-checkout-manager/lib/view/frontend/class-fields-disable.php on line 157
The product list page itself opens all right. The 500 responses go to AJAX requests like these:
/wp-json/wc-admin/onboarding/tasks?_locale=user /wp-json/wc-admin/options?options=woocommerce_ces_tracks_queue&_locale=user /wp-json/wc-analytics/admin/notes?page=1&per_page=25&type=error%2Cupdate&status=unactioned&_locale=user /wp-json/wc-admin/options?options=woocommerce_allow_tracking&_locale=user
Tested with WooCommerce Checkout Manager 7.0.3, WooCommerce 7.4.0, Polylang 3.3.1.
The errors disappear if I disable either WooCommerce Checkout Manager or Polylang.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting PHP errors “get_cart_contents() on null” in admin’ is closed to new replies.