Opened 14 years ago
Closed 14 years ago
#16166 closed defect (bug) (fixed)
Ajax Table Sorting Session Broken with Bulk Actions
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch needs-testing dev-feedback |
Focuses: | Cc: |
Description
The 3.1 new ajax table sorting is loosing data in its session when js + bulk requests are used in the session.
I ran over it while analyzing why pagination is lost in #16162 and it came to my attention that sorting is lost as well. While the number of the page is easier to aquire, sorting information can get lost in a session of http requests (as a more formal description of "using the admin").
The loss is a session break between Ajax and non-Ajax requests:
- If JavaScript is enabled, the table contents is requested via an Ajax request, the location of the page does not change while navigating the table's data.
- If JavaScript is disabled, the table contents is requested via a standard HTTP "full page" request, the location of the page does change.
The session break now is when bulk actions come into play: Bulk actions are triggering a "full page" request but without leaving any information (or at least without leaving sorting information) to the HTTP request scope as long as those information has been gathered by JavaScript processes.
With JavaScript disabled, the sorting information is not lost.
Bulk actions should always have all navigation related information regardless how the data to create that request has been acquired by the user: Via ajax calls or by simple HTTP "full page" requests.
Attachments (5)
Change History (31)
#2
@
14 years ago
Another symptom of this bug: Navigating through pages via Ajax (let's say you go to page 5 in the media library) and then enabling sorting on a column (let's say File) will bring you back to page 1. This symptom is even without a Bulk request. It's just js requests.
#3
@
14 years ago
- Keywords ux-feedback added
- Milestone changed from Awaiting Review to 3.1
It sends you back to page 1 on purpose, after performing a search or a sort.
Maybe it doesn't make sense to reset pagination when sorting?
#4
@
14 years ago
Next to that it doesn't make sense, from the serverside, I missed the full pagination data (page-number, sort-column, sort-direction) to create usefull redirect locations server-side. The request only has "paged" from the input.
#5
follow-ups:
↓ 8
↓ 18
@
14 years ago
I just looked at a couple web sites/apps that have both paging and sorting to see what they do. Typical behavior is to go to page one when a sort is done. The go-to app for behavior checks, gmail, doesn't have paging anymore, since they switched over to river-style (a la twitter).
#6
@
14 years ago
- Summary changed from Ajax Table Sorting Session Broken with Bulk Actions to Pagination is reset after sorting
#7
@
14 years ago
- Keywords ux-feedback removed
Thanks Jane.
I guess we then have to find another way to fix the problems caused by this.
#8
in reply to:
↑ 5
;
follow-up:
↓ 9
@
14 years ago
Replying to jane:
I just looked at a couple web sites/apps that have both paging and sorting to see what they do. Typical behavior is to go to page one when a sort is done. The go-to app for behavior checks, gmail, doesn't have paging anymore, since they switched over to river-style (a la twitter).
From what I can see in well-made (web)apps is, that if you change the view, the focus stays. Let's say, you're in a list on element 60 (out of 500), numerically sorted ASC, so #60 is POS:60 as well, after sorting the opposite, you're still with focus on #60 while pos is POS:500-60 now. But never is pos POS:1.
Set items per page to 1 and try with wordpress ;)
#9
in reply to:
↑ 8
;
follow-up:
↓ 11
@
14 years ago
Replying to hakre:
From what I can see in well-made (web)apps is, that if you change the view, the focus stays.
Which ones are you looking at?
#10
@
14 years ago
hakre, I think you're suggesting "local" sorting, i.e. to only sort the items currently in view, right?
I think that's less useful than the global sorting we currently have.
#11
in reply to:
↑ 9
@
14 years ago
Replying to jane:
Replying to hakre:
From what I can see in well-made (web)apps is, that if you change the view, the focus stays.
Which ones are you looking at?
Any application of which has some list - the viewable part of the list is comparable to the viewable page in wordpress. paging is scrolling.
Try Yahoo Mail if you're looking for some table/list that is actually sortable.
I think tine 2.0 has this as well.
Replying to scribu:
hakre, I think you're suggesting "local" sorting, i.e. to only sort the items currently in view, right?
No, infact, it's without the word "only" so probably what you called "global".
But I have no problem to focus on the same item, if that's what you call "local".
#12
@
14 years ago
This is one test I did: Compare use with javascript on and off. Compare the different behavior. If you do bulk actions both things are broken. But w/o bulk actions, I have the feeling that w/o javascript works a bit more useful then with javascript.
#13
@
14 years ago
- Keywords has-patch added
My patch doesn't prevent pagination from resetting when you sort. However, it does prevent order and orderby from resetting when you bulk edit.
#14
@
14 years ago
- Summary changed from Pagination is reset after sorting to Ajax Table Sorting Session Broken with Bulk Actions
Yeah, we should focus on fixing the bulk action behaviour.
#17
@
14 years ago
We need to go through the other list tables to see where else that add_query_args code needs to end up.
#18
in reply to:
↑ 5
@
14 years ago
- Cc WordPress@… added
Replying to jane:
The go-to app for behavior checks, gmail, doesn't have paging anymore, since they switched over to river-style (a la twitter).
I can't find any river-style view in Gmail, even with &labs=0
. But Gmail doesn't have sorting anyway, nor does it have the ability to switch between ajax and full-page requests within a session. (Users either have full ajax or a basic HTML page.)
#23
@
14 years ago
After some additional discussion, the 11 list tables that implement bulk actions have too many differences and idiosyncrasies to implement what we were thinking. (You can see the general idea in [17275].) We'll be adding bandaids at this point.
I tested the fix in #15416 and it has the same problem. Sorted pagination is broken with bulk actions.