Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32416 closed defect (bug) (wontfix)

List table: the link on the initial sorted column header should always change the initial order

Reported by: afercia's profile afercia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Administration Keywords: has-patch dev-feedback
Focuses: ui, accessibility Cc:


Please consider the following 2 examples:

  • in the Posts list the initial view is ordered by date and in descending order but when you click the link on the "Date" table header you get the same descending order
  • in the Users list the initial view is ordered by login (username) and in ascending order but when you click the link on "Username" you get the same ascending order

Users are forced to click two times to get what they want. This happens just in the initial view, the following times $_GET['orderby'] and $_GET['order'] are set and the links are set up properly.

As far as I see, in some cases the fix would be simple (e.g. for Users, see get_sortable_columns()) but in other cases like Posts and Pages it's not so simple. Perhaps a more general solution would be making WP_List_Table aware of each screen initial "orderby" and "order" but this would require some changes to the main class and some leads eyes on it. Any thoughts more than welcome.

See related #32170 for which I'd say this is a blocker.

Attachments (2)

32416.partial.patch (1.5 KB) - added by afercia 9 years ago.
partial fix
32416.partial.2.patch (3.8 KB) - added by afercia 9 years ago.

Download all attachments as: .zip

Change History (7)

#1 @afercia
9 years ago

Alternatively, consider to have both "asc" and "desc" links displayed at the same time. But in this case the link corresponding to the current "orderby" and "order" should be disabled and we would still need to know which is the initial setup.

9 years ago

partial fix

#2 @afercia
9 years ago

  • Keywords has-patch dev-feedback added

Proposed patch is a partial fix for just "Media" (list mode) and "Users" screens.

#3 @afercia
9 years ago

Refreshed patch fixes the link for the initially sorted column also for:

  • non hierarchical taxonomies (tags)
  • /network/users.php
  • /wp-admin/link-manager.php (Link manager is now a plugin)

Please notice that for hierarchical posts (pages) and hierarchical taxonomies (categories) the only way to display again the initial sorting (the one with nested items) is clicking on the link in the main admin menu. Couldn't find any control available in the table to sort it again in the "hierarchical sort".

Additional notes

  • in /network/themes.php the themes collection is reversed via code so ?orderby=name&order=asc returns items in z-a order and vice-versa
  • in /network/sites.php which are the default orderby and order? Maybe the default should be set by 'blogname'?

Would greatly appreciate some leads feedback about the best approach to follow here, maybe worth it a more elegant solution? Also, about the hierarchical things issue, and their custom default sorting.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.

9 years ago

#5 @afercia
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I'd propose to close this ticket and handle this issue in #32170 where we need to show the sorting indicator arrows in the initial view and fix the links accordingly.

Note: See TracTickets for help on using tickets.