Something went wrong with processing the default view and we have restored the filter to its original state.
So says the
product grid in the backend of Magento 2 when you're innocently trying to edit stuff.
This is something to do with filtering although I don't entirely (yet) know how to trigger it.
The Fix:
Well, looking around, I found
this page on stackexchange which has a couple of solutions, but for me the solution appears (because you never want to fully commit in magento 2!) to solve this.
Go to
phpmyadmin, table
admin_user, and figure out the
user_id of the affected user by just looking at the table. Write that down.
Then go to table
ui_bookmark and find the row for
any other user_id, copy the contents of key
config for namespace
product_listing identifier
current, into the same field of the affected
user_id
Or to try to put it simply, copy across the contents of the config field from one that works for another user.
I feel like you ought to be able to just delete the line for the affected user_id too, as I notice they're not generated for pages you haven't looked at before, so it should regenerate it, but I felt that my way of copying the data would be safer without looking at how the code works.
This field contains a load of information on which fields were last sorted and filtered it seems. Resetting that with good data fixes this, without having to clear any caches or reindex.
Looks harder than it is, trust me.
Oh and don't forget to backup your database first!
Update:
It kept happening. Digging a bit further it seems it's being caused or partly caused by having "sku" to "Null" on some values in the
catalog_product_entity table.
props to
this site for figuring that out somehow
If you go into phpmyadmin, load up catalog_product_entity, and sort based on sku column, you might (probably will!) see some values of SKU with "Null".
The reason this happened is because in magento 1 at least, if you duplicate a product, it creates a duplicate with blank SKU. If you then save it and don't enter an SKU, or don't save it, I think you get these null sku products.
Hmm.