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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bblake’s picture

FileSize
481 bytes

Had 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.

bblake’s picture

Status: Active » Needs review
slashrsm’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine and fixes this issue for me.

jbrown’s picture

Status: Reviewed & tested by the community » Needs work

This patch fixes the bug, but needs a test written.

agentrickard’s picture

Priority: Normal » Major
Status: Needs work » Needs review
FileSize
3.06 KB

Updated with a test. Green on my machine. Bumping to major, as this is a UX fail. Almost critical.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

Ahh, that's so much better.

slashrsm’s picture

Excelent!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wow. :) Now that's a stupid bug. Thanks for the fix, bblake (and the test, agentrickard)!

Committed to HEAD!

David_Rothstein’s picture

This 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.

sun’s picture

Thanks for this fix -- searching for existing issues + patches would have yielded #897564: Node updated status marker incorrect on content overview

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.