WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#35620 closed defect (bug) (fixed)

Some WP_List_Table links for users preserve removable query args

Reported by: desrosj Owned by: rachelbaker
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Users Keywords: good-first-bug has-patch commit
Focuses: administration Cc:

Description

When certain actions are performed in the user admin and query args are used to relay notices, the arguments are preserved in certain links on the page.

To reproduce:

  1. Go to a user admin screen with pagination active.
  2. Use the select at the top of the page to change a user's role on the current screen.
  3. Click on a pagination link to go to a different page.

Notice that while the query arg is gone (I believe from improved admin notices related functionality: https://make.wordpress.org/core/2015/04/23/spinners-and-dismissible-admin-notices-in-4-2/), the notice will persist when clicking through pagination.

The query arg also persists in the page form's hidden referrer field.

Attachments (2)

35620.diff (642 bytes) - added by EFAREM 4 years ago.
Remove the update query arg from pagination links
35620.1.diff (1.2 KB) - added by rachelbaker 4 years ago.
Remove all the wp_removable_query_args() during list-table pagination

Download all attachments as: .zip

Change History (9)

#1 @desrosj
4 years ago

Possibly related #32692

#2 @ocean90
4 years ago

  • Component changed from Administration to Users
  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version trunk deleted

@EFAREM
4 years ago

Remove the update query arg from pagination links

#3 @darrenlambert
4 years ago

I tested this, and the patch works correctly.
The message is not shown when jumping to other pages, using the pagination, after updating the role. i.e. the message correctly disappears on subsequent pages.
The list jumps to page 1, after changing the role, but this was the behaviour before the patch also.

#4 @DrewAPicture
4 years ago

  • Keywords has-patch added; needs-patch removed
  • Owner set to EFAREM
  • Status changed from new to assigned

Assigning to mark the good-first-bug as "claimed".

See 35620.diff

#5 @rachelbaker
4 years ago

  • Keywords commit added
  • Milestone changed from Future Release to 4.6
  • Owner changed from EFAREM to rachelbaker
  • Status changed from assigned to accepted

@rachelbaker
4 years ago

Remove all the wp_removable_query_args() during list-table pagination

#6 @rachelbaker
4 years ago

35620.1.diff adds the keyboard navigation query vars to wp_removable_query_args() and passes the results of said function to remove_query_var() on pagination.

#7 @rachelbaker
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 37663:

Users: Stop WP_List_Table notices from persisting on pagination navigation.

Adds the keyboard navigation query vars to wp_removable_query_args() and passes the results of said function to remove_query_var() inside the WP_List_Table pagination method.

Props EFAREM for the initial patch.
Fixes #35620.

Note: See TracTickets for help on using tickets.