Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39435 closed defect (bug) (fixed)

cannot advance by typing in page number

Reported by: taxman10m Owned by: SergeyBiryukov
Priority: normal Milestone: 4.8
Component: Users Version: 4.7
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses:

Description

When looking at a users from a group, the pagination does not advance to the correct page in the group if the page number is manually inputted.

To recreate:

Go to the users page.
Click into any group other than All.
Where it says, X of Y pages, change the value of X and hit enter.

The results will be of All, and not of the selected group.

Attachments (4)

WP user page bug.png (16.0 KB ) - added by taxman10m 10 years ago.
screenshot
39435.patch (753 bytes ) - added by kailanitish90 10 years ago.
39435-1.patch (522 bytes ) - added by sagarprajapati 10 years ago.
Patch without extra spaces
39435.2.patch (586 bytes ) - added by sagarprajapati 10 years ago.

Download all attachments as: .zip

Change History (17)

@taxman10m
10 years ago

screenshot

#1 @kailanitish90
10 years ago

  • Keywords has-patch added

Hi @taxman10m,

I have attached a patch for above issue.

Thanks

@sagarprajapati
10 years ago

Patch without extra spaces

#2 @sagarprajapati
10 years ago

Hi @kailanitish90, @taxman10m

Here no need to add the blank space at the do_action( 'restrict_manage_users', $which );

Thanks

This ticket was mentioned in Slack in #core-editor by kailanitish90. View the logs.


10 years ago

#4 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review4.8

#5 @adamsilverstein
10 years ago

@kailanitish90 thanks for the patch! how did you figure out you needed to add the hidden role field?

I'll give this a test, it would be good to also get feedback from @taxman10m to verify it fixes the issue for him.

it looks like $_REQUEST['role'] could use some sanitization or escaping on output to prevent XSS

#6 @afercia
10 years ago

It seems to me something similar happens also in other places. For example, on the posts screen: click on the "Mine" link so posts are filtered by your author ID (e.g. &author=1). Then use the page number input field in the pagination as described above, and the author parameter is lost.
To make testing easier in the various list tables screens, you could set the Screen Options "Number of items per page" to something lower than the default value.

#7 @kailanitish90
10 years ago

Hi @adamsilverstein, @taxman10m,

I have used hidden field because we can not get any particular role without set it into hidden field. Like in the post, post status post_status=publish .

As per @sagarprajapati patch I think is better to set the hidden field after end-if condition.

Thanks

#9 @sagarprajapati
10 years ago

Hi,

I have updated my patch with esc_attr. Please check this patch.

Thanks

#10 @swissspidy
10 years ago

  • Keywords needs-testing added

#11 @mayurk
10 years ago

Hi @taxman10m , @kailanitish90 , @sagarprajapati , @swissspidy , @SergeyBiryukov

I have tested 39435.2.patch with the core latest WordPress version and it's working as expected.

Thanks

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


10 years ago

#13 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 39937:

Users: Preserve role filter in list table after entering a page number in paging input.

Props kailanitish90, sagarprajapati.
Fixes #39435.

Note: See TracTickets for help on using tickets.