0

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.

  • Apparently the order by clause is messing the whole thing up, any ideas? – AL-Kateb Nov 9 '19 at 17:25
0

Apparently, this is a bug with WordPress, it's still incompatible with MySQL 8, a quick patch could be found at this link:

https://core.trac.wordpress.org/ticket/48377

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.