WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 20 months ago

#17141 closed defect (bug) (fixed)

In WP Admin -> Posts, sorting the list by Author actually sorts by Author ID

Reported by: aneesme Owned by: ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch commit
Focuses: Cc:

Description

When I click on the author column title to sort the post listing by the author, it sorts by author id and I see the list messed up.

Attachments (1)

17141.diff (522 bytes) - added by scribu 20 months ago.
make 'author' column non-sortable

Download all attachments as: .zip

Change History (10)

comment:1 scribu3 years ago

This was always the case; now it's just more visible.

The argument is that the wp_posts table shouldn't be JOINed to the global wp_users, which can get quite large on Multisite setups.

Version 0, edited 3 years ago by scribu (next)

comment:2 scribu3 years ago

  • Summary changed from In Dashboard->Posts, sorting the list by Author actually sorts by Author ID to In WP Admin -> Posts, sorting the list by Author actually sorts by Author ID

Also, we call dashboard only the first screen: wp-admin/index.php

What you're refering to is the administration area.

comment:3 russellwwest2 years ago

  • Owner set to russellwwest
  • Status changed from new to accepted

comment:4 nacin22 months ago

One could argue that the author column simply shouldn't be sorted. You can already click a single author's name to filter them down. If you can filter, and the sort is buggy, why have it? It could be implemented instead as a plugin.

comment:5 scribu22 months ago

The expectation would be that it sorts by wp_users.displayname. If that's not acceptable, I agree that we should disable sorting. We did the same on the Users screen when it came to post counts.

Last edited 22 months ago by scribu (previous) (diff)

comment:6 russellwwest21 months ago

  • Owner russellwwest deleted
  • Status changed from accepted to assigned

comment:7 nofearinc20 months ago

@scribu, I don't think that there is a way to order authors by author name without using a JOIN clause. A join would indeed affect the performance seriously having a large posts or users table but currently order_by takes place only for fields from the posts table.

There could probably be an extra screen (implemented by a plugin) for listing this, but a join-driven one.

scribu20 months ago

make 'author' column non-sortable

comment:8 scribu20 months ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 3.5

comment:9 ryan20 months ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from assigned to closed

In [21743]:

Remove not so useful author column sorting. Props scribu. fixes #17141

Note: See TracTickets for help on using tickets.