Page MenuHomePhabricator

Duplicated url parameter profile=advanced in fulltext search
Closed, DuplicatePublic

Description

Steps to reproduce:

  1. Open Special:Search
  2. click "Advanced" in the box below the search field
  3. type something in the search field and click "Search"

There will be now an url like:
index.php?title=Special%3ASearch&profile=advanced&search=test&fulltext=Search&ns0=1&profile=advanced

Tested on dewiki, enwiki and some others.

Event Timeline

Inkowik raised the priority of this task from to Needs Triage.
Inkowik updated the task description. (Show Details)
Inkowik added a project: MediaWiki-Search.
Inkowik added a subscriber: Inkowik.

I've tried to use the feature "Upload File" but it didn't work with Firefox Nightly and Chrome. These are my changes. I'm not sure about them:

From a3bc071a1ba433817d27a963a818b274cd0ae5e8 Mon Sep 17 00:00:00 2001
From: Willian Gustavo Veiga <contact@willianveiga.com>
Date: Sat, 17 Jan 2015 18:03:19 -0200
Subject: [PATCH] Remove the cause of "&profile=advanced" URL parameter
 duplication.

---
 includes/specials/SpecialSearch.php | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php
index 55be2c2..c34998c 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -915,11 +915,6 @@ class SpecialSearch extends SpecialPage {
 
 		Hooks::run( 'SpecialSearchPowerBox', array( &$showSections, $term, $opts ) );
 
-		$hidden = '';
-		foreach ( $opts as $key => $value ) {
-			$hidden .= Html::hidden( $key, $value );
-		}
-
 		# Stuff to feed saveNamespaces()
 		$remember = '';
 		$user = $this->getUser();
@@ -945,7 +940,6 @@ class SpecialSearch extends SpecialPage {
 			Xml::element( 'div', array( 'id' => 'mw-search-togglebox' ), '', false ) .
 			Xml::element( 'div', array( 'class' => 'divider' ), '', false ) .
 			implode( Xml::element( 'div', array( 'class' => 'divider' ), '', false ), $showSections ) .
-			$hidden .
 			Xml::element( 'div', array( 'class' => 'divider' ), '', false ) .
 			$remember .
 			Xml::closeElement( 'fieldset' );
-- 
2.1.4

This is my first attempt to help WikiMedia, sorry if I am doing something wrong.

Thank you.

Change 256896 had a related patch set uploaded (by Deskana):
Remove duplicated parameter when doing advanced searches

https://gerrit.wikimedia.org/r/256896

This is my first attempt to help WikiMedia, sorry if I am doing something wrong.

Thanks! Your approach seemed to work when I tested it, so I uploaded it in the form of the above patch. We'll see whether it works. :-)

Deskana moved this task from Needs triage to Search on the Discovery board.
Deskana lowered the priority of this task from Low to Lowest.Dec 8 2015, 1:13 AM
Deskana added a subscriber: EBernhardson.

The above change was reviewed by @EBernhardson who said that this change is almost certain to cause unintended side effects, but it would take a lot of time to investigate what those side effects are. The search page code is a mess and it would require a very large amount of effort to test it properly. Given that this bug only results in slightly ugly URLs, and doesn't really hurt anyone, it cannot be prioritised right now.

Change 256896 abandoned by Deskana:
Remove duplicated parameter when doing advanced searches

Reason:
I'm abandoning this so it doesn't sit around for an excessively long time. If someone wants to pick this up, feel free to restore it and take over.

https://gerrit.wikimedia.org/r/256896