I migrated my database to a new host, as well as my WordPress files, I have an online shop using WooCommerce, and everything ran smoothly after migration, what I did not notice at first was that WooCommerce categories are no longer displayed in the admin panel, When I visit:
/wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product it gives me two pages, and says 26 items, but nothing is displayed in the list.
I reviewed the error log and found a few queries that should be related to this issue for example:
SELECT DISTINCT t.*, tt.* FROM wp_terms AS t LEFT JOIN wp_termmeta ON ( t.term_id = wp_termmeta.term_id AND wp_termmeta.meta_key='order') INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('product_cat') AND ( ( wp_termmeta.meta_key = 'order' OR wp_termmeta.meta_key IS NULL )) ORDER BY wp_termmeta.meta_value+0 ASC, t.name ASC
And when I run this query, MySQL says:
#3065 - Expression #1 of ORDER BY clause is not in SELECT list, references column 'as7ab_db.wp_termmeta.meta_value' which is not in SELECT list; this is incompatible with DISTINCT
I updated WooCommerce to the latest version, but the problem is still present.