Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The table in admin/content says that it shoud be sorted by Update time - DESC, but it is sorted ASC. (see attached image)
If I then click on header of col "Updated" it changes sort to ASC. Output stays exactly the same, except the arrow in the header, which flips upside-down. If I click on the same header for another time, it finally changes to DESC and the arrow is flipped again. Now is arrow finally consistent with actual sort.
This is quite anoying bug, since site administrators expect to find latest posts on top of the list.
Comment | File | Size | Author |
---|---|---|---|
#5 | 993026-sort-nodes-with-test.patch | 3.06 KB | agentrickard |
#1 | tablesort_sort_993026.patch | 481 bytes | bblake |
sort.png | 19.17 KB | slashrsm |
Comments
Comment #1
bblake CreditAttribution: bblake commentedHad the same issue. Upon deeper review, this is a bug in the tablesort.inc file in core. One line is assuming that it has an array, so isset($header['sort']) returns 'A' ( from 'Author' ), when it should return FALSE.
Patch attached.
Comment #2
bblake CreditAttribution: bblake commentedComment #3
slashrsm CreditAttribution: slashrsm commentedLooks fine and fixes this issue for me.
Comment #4
jbrown CreditAttribution: jbrown commentedThis patch fixes the bug, but needs a test written.
Comment #5
agentrickardUpdated with a test. Green on my machine. Bumping to major, as this is a UX fail. Almost critical.
Comment #6
mlncn CreditAttribution: mlncn commentedAhh, that's so much better.
Comment #7
slashrsm CreditAttribution: slashrsm commentedExcelent!
Comment #8
webchickWow. :) Now that's a stupid bug. Thanks for the fix, bblake (and the test, agentrickard)!
Committed to HEAD!
Comment #9
David_Rothstein CreditAttribution: David_Rothstein commentedThis bug was caused by #839556: Fix isset regression in tablesort, add tests, and cleanup theme_process_registry() and was being fixed in a followup there - however, the followup patch there kind of expanded into infinity and therefore hasn't been committed yet, so it is good to see this fixed in a dedicated issue :) I'm not sure anyone there realized there was an actual, noticeable bug that resulted from it.
However, the fix here is incomplete because it does not address the same issue in tablesort_get_sort(). That's contained in the patch at the other issue, currently.
Comment #10
sunThanks for this fix -- searching for existing issues + patches would have yielded #897564: Node updated status marker incorrect on content overview