WordPress.org

Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#43960 new defect (bug)

Support for sorting columns in WP_Privacy_Requests_Table

Reported by: birgire Owned by:
Milestone: 4.9.8 Priority: normal
Severity: normal Version: trunk
Component: General Keywords: gdp needs-testing has-patch needs-refresh
Focuses: administration Cc:

Description

We should consider adding a support for sorting columns in the WP_Privacy_Requests_Table class.

The requester and requested columns look suitable for sorting.

Attachments (3)

43960.diff (3.3 KB) - added by birgire 7 weeks ago.
43960.2.diff (3.2 KB) - added by birgire 7 weeks ago.
Screen Shot 2018-05-07 at 9.53.38 AM.png (20.7 KB) - added by desrosj 7 weeks ago.

Download all attachments as: .zip

Change History (14)

@birgire
7 weeks ago

#1 @birgire
7 weeks ago

  • Keywords has-patch added

43960.diff is a first pass that:

  • Adds support for sorting the requester and requested columns, that are mapped to title and post_date_gmt db cols ordering.
  • Uses paged instead of offset query parameter.
  • Doesn't override the default search order.
  • Sets the default requested order direction as descending.
  • Sets the default requester order direction as ascending.
  • Sets the screen argument for the instantiation of the table objects, to avoid setting $this->_column_headers directly.
Last edited 7 weeks ago by birgire (previous) (diff)

#2 @desrosj
7 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 4.9.6

#3 @ianbelanger
7 weeks ago

The patch does allow for sorting of requester and requested columns, but it will only sort on the first click, after that the order does not change again.

Last edited 7 weeks ago by ianbelanger (previous) (diff)

@birgire
7 weeks ago

#4 @birgire
7 weeks ago

Thanks @ianbelanger for testing it, I fixed the typos in 43960.2.diff ;-)

#5 @ianbelanger
7 weeks ago

No problem @birgire, just tested the new patch and all is working fine now.

#6 @desrosj
7 weeks ago

This works well. One thing I noticed, though, is that when you sort by date, the default order is correctly reversed but the arrow on the table is incorrect. Incoming screenshot.

#7 @ianbelanger
7 weeks ago

@desrosj was that on :hover? It seems to be the default in sortable columns, that on hover it will show the direction that clicking will give you, ASC or DESC. Since this table defaults to DESC, hovering will give you the ASC arrow. See Pages or Posts tables for same behavior, just opposite because they default to Date ASC instead of DESC. Behavior seems normal to me on Chrome 66.0.3359.139

This ticket was mentioned in Slack in #core by desrosj. View the logs.


7 weeks ago

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 weeks ago

#10 @desrosj
6 weeks ago

  • Keywords needs-refresh added
  • Milestone changed from 4.9.6 to 4.9.7

This needs a refresh, and we just ran out of time for 4.9.6. Punting to 4.9.7.

Last edited 6 weeks ago by desrosj (previous) (diff)

#11 @desrosj
5 weeks ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

Note: See TracTickets for help on using tickets.