Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-8655 now.

search result (sr) variable won't stay when manually set (fix completed in vcs)

If you on any of the search pages manually add
Code: Select all
&sr=posts
(default search result is set to topic view), and you navigate to the next page the sr variable is dropped and the topic view is used on the next page.
The problem is caused by the way this variable is assigned to the URI that is passed into the generate_pagination() function.

Comments / History

Edited ticket

Action performed by Erik Frèrejean (Support Team Member) on Sep 4th 2009, 23:14

Edited ticket

Action performed by Erik Frèrejean (Support Team Member) on Sep 4th 2009, 23:14

Posted by Erik Frèrejean (Support Team Member) on Sep 4th 2009, 23:25

Having had a second look at it, it looks like there is some funky stuff going around with the "$show_results" variable which defines in which way the results are show.
First it is set on top of search.php, based upon the value of the sr variable in the request, but later on its overwritten by either a hardcoded value or based upon the "sr" variable but with a different default value.

Posted by Acyd Burn (Server Manager) on Sep 7th 2009, 11:37

Sorry, but i am not able to reproduce this. posts is the default mode for search - it is not included in the pagination url if set to posts. If set to topics it is included.

If i now search for "test" and set the view to topics then i get the result in topics view (the sr= is in the URL). If i now change the URL to have sr=posts i get the posts view search results and the pagination url does not have the sr= included. Going to page 2 shows the results as posts.

Tested here at phpbb.com

Posted by ToonArmy (Development Team Member) on Sep 7th 2009, 11:59

Posted by Acyd Burn (Server Manager) on Sep 7th 2009, 12:17

The unanswered mode should never allow posts. ;) It is supposed to support only topics view (hence the default set to topics).

Posted by Acyd Burn (Server Manager) on Sep 7th 2009, 12:21

But i see the problem. It is not really hardcoded for unanswered for example... I think sr= was passed before "as is" - i think this should be done anyway, but i will look up the repository if this change was made on purpose.

Linked ticket with changeset: r10117

Action performed by Acyd Burn (Server Manager) on Sep 7th 2009, 12:39

Changed ticket status from "New" to "Fix completed in SVN"

Action performed by Acyd Burn (Server Manager) on Sep 7th 2009, 12:39

Ticket details

Related SVN changesets