Opened 10 months ago

Last modified 10 months ago

#21207 new defect (bug)

Link-template pagination link for page 1 missing query string args

Reported by: alexk45 Owned by:
Priority: normal Milestone: Awaiting Review
Component: Template Version: 3.4
Severity: normal Keywords: reporter-feedback
Cc:

Description

In paginated pages, when on a page that is greater than page 1, the link for page 1 and the 'previousposts' link do not include any query arguments. This is fine if not including the first page argument, but not for other arguments in the query string.

For example pages that show results for form searches. The search criteria are stored with the GET method as query strings in the URL and need to be maintained from page to page as the user pages through their results.

This is in /wp-includes/link-template.php on line 1421.
A probable fix is the 'if' clause from if( $pagenum > 1 ) changed to if( $pagenum > 0 ).

I was wondering if you can apply this fix to future updates?

Thanks

Change History (2)

  • Component changed from General to Template
  • Keywords reporter-feedback added

Unable to reproduce this on 3.4 or trunk with the previous_posts_link() function. Page 2 of a search results page (example.com/page/2/?s=test) shows the correct link to the first results page (example.com/?s=test).

Can you reproduce the bug with the default theme and all your plugins deactivated?

Could not reproduce either.

Note: See TracTickets for help on using tickets.