Undefined array key “post_type” on Orders Page
-
The owner of this website has been complaining of slow operations in the backend. I have done a few things to speed up the site including installing Memcached and adding an object cache amongst other things. I installed Query Monitor plugin and apart from deprecated warnings, there doesn’t seem to be any problems until I go to view the Woocommerce > Orders. This error warning then shows in red in Query Monitor:
WarningUndefined array key “post_type”+
- wp-content/plugins/woocommerce/includes/admin/list-tables/class-wc-admin-list-table-orders.php:711
1Plugin: woocommerce
CoPilot suggests the following fixes:
$post_type = isset($_REQUEST[‘post_type’]) ? $_REQUEST[‘post_type’] : ”;
Or, using null coalescing (php7+)
$post_type = $_REQUEST[‘post_type’] ?? ”;
I understand that any fix would only be effective until the next update, so this would not be a permanent fix. Has anyone else found this issue and has a long term workaround?
P.S. We are using php 8.2
The page I need help with: [log in to see the link]
The topic ‘Undefined array key “post_type” on Orders Page’ is closed to new replies.