WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#18094 closed defect (bug) (fixed)

Changing pages in Theme Search loses selected features

Reported by: lorthirk Owned by: ryan
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.2.1
Component: Administration Keywords: has-patch early
Focuses: Cc:

Description

Using Wordpress 3.2.1.

I search for a theme using Feature search (e.g. color: brown). 133 themes (5 pages) are returned. Skipping on page 2 shows, instead all the themes (1.411, 48 pages) regardless of the features selected before.

As a side note, here's the url pointed by the "next page" button: <wordpress-root>/wp-admin/theme-install.php?tab=search&paged=2

Attachments (2)

18094.patch (1.7 KB) - added by SergeyBiryukov 4 years ago.
18094.input_question.png (202.3 KB) - added by kurtpayne 4 years ago.
What is this input for?

Download all attachments as: .zip

Change History (16)

comment:1 @lorthirk4 years ago

More troubleshooting: after the first search, if I click "search" again (thus repeating the same search), pagination works correctly. So the problem occurs only coming from the "search" tab. I did some debugging of POST parameters, and they are different:

Coming from "Search" tab (not working):

QueryString is: ?tab=search

Form data contains:

features%5Bbrown%5D:brown, search:Trova temi

Instead, clicking again on "search" on the results tab (Working):

QueryString is: tab=search&type=tag&s=brown&search=Cerca

No form data in this case.

comment:2 @lorthirk4 years ago

  • Cc cm0901@… added

comment:3 @kawauso4 years ago

  • Keywords needs-patch added

On a related note, the page number input is broken since it's not inside a form.

comment:4 @nacin4 years ago

  • Milestone changed from Awaiting Review to 3.2.2

comment:5 @teraom4 years ago

  • Cc teraom added

comment:6 @teraom4 years ago

Newbie to WP dev.

The problem occurs because the basic search and the feature filter search use POST and GET types respectively. When using post, the features[] is set in POST, which is not set in URL. The generic pagination WP_List_Table -> pagination function is ignorant of the POST variables and only appends "paged" to the URL.

Possible (naive) solutions:

  1. Check of form action type is POST, redirect to the corresponding GET URL
  2. Generic helper function append_pagination_args, which can attach more vars to the URL?
Version 0, edited 4 years ago by teraom (next)

@SergeyBiryukov4 years ago

comment:7 @SergeyBiryukov4 years ago

  • Keywords has-patch added; needs-patch removed

@kurtpayne4 years ago

What is this input for?

comment:8 @kurtpayne4 years ago

  • Cc kpayne@… added

Tested and verified that it works with latest trunk.

The page number input, however, did not seem to be connected to any events or forms. See 18094.input_question.png for a picture. What is this input for? If this is just for visual feedback, should it be blurred immediately upon input?

comment:9 follow-up: @SergeyBiryukov4 years ago

Good catch. To be clear, this currently happens without the patch too, and on "Install Plugins" screen as well. There's no form around that input on these screens.

Probably needs a new ticket.

comment:10 in reply to: ↑ 9 @kurtpayne4 years ago

@SergeyBiryukov, you are correct. The non-functioning page input happens in 3.2.1 and is unrelated to this patch.

As you suggested, I created ticket #18724 for this bug.

I found no other defects in my testing of 18094.patch.

comment:11 @ryan4 years ago

  • Keywords early added
  • Milestone changed from 3.2.2 to Future Release

comment:13 @ryan3 years ago

  • Milestone changed from Future Release to 3.4

comment:14 @ryan3 years ago

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

In [19857]:

Change feature filter from post to get so feature selections aren't lost when paging. Props SergeyBiryukov. fixes #18094

Note: See TracTickets for help on using tickets.