When viewing order, I expect changing the page to display that page's orders.
The 1st page's order are shown regardless of the page I choose.
1) Go to the order history page
2) Change the current page to 2
3) Notice you still have the same results from page 1
I noticed this while on branch issue/7173
This appears, at a quick glance, to be because the query class isn't taking the paged query var into consideration.
@jjj can you correct me in case I'm missing something? I looked through the base Query class and didn't see anything where paged is passed through to the DB calls for offsets.
You are correct that the Query class does not directly support paged. Instead, both limit and offset are supported. This is because the Query class is responsible for the MySQL layer, not the WordPress admin layer, and it's the WordPress admin layer that provides the UI for changing the pagination values (the limit and offset) from their defaults.
Looking at how the List_Table class works though, this division of duties might be too rigid. At the very least, we will need a method to take a paged value and translate it into limit and offset values.
(See: EDD_Customer_Email_Addresses_Table for an example of how it's handled there.)
I'll put together a PR shortly.
Looks like a minor tweak is needed, looking into it now. Page 1 and 2 are the same, but page 3 finally gives changes. Just looks like we have a small issue with the offset calculation. I'll push up a change that fixes it shortly.
@jjj appears to be something with the array_unique. It's removing our offset when paged === 2. This is because array_unique is looking for unique values and we're doing an int 30 for per page with with paged being 2 we then have an offset of double 30. Even though they are different data types, PHP's array_unique call is seeing them as equal and dropping the offset for page 2.
Maybe we stick with unique array keys?
Confirmed fixed on issue/7208