Page MenuHomePhabricator

Namespace parameters in the url should be shown in the namespace bar
Closed, ResolvedPublic3 Estimated Story Points

Description

Bug report
When using a Search-InputBox provided by Extension:InputBox to search for something with the option prefix or namespaces Advanced Search breaks.

Example: Go to https://de.wikipedia.org/wiki/Hilfe:%C3%9Cbersicht an search for something in the archive with the given Search-box. The search will give you the right results but the filters set by the InputBox will not be shown in the Advanced Search-Form. If you click search again you will get different results, ignoring the filters.

Task
When the url contains namespace info, such as "...&ns12=1....", these namespaces are selected in the namespace widget and overwrite the defaults

Acceptance criteria

  • When I reach the specialPage:Search with a url that contains namespace info, this namespace info can also be found in the namespace box.
  • When there is no info in the url, the namespace behavior remains unchanged (i.e. default settings)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 413365 had a related patch set uploaded (by Gabriel Birke; owner: Gabriel Birke):
[mediawiki/extensions/AdvancedSearch@master] Allow URL preselection of namespaces

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

I stumbled upon this and the solution seemed so straightforward to me, I wrote a PR for it. Together with T172260: Default namespaces is what has been defined in user preferences we now have the following behavior when coming to the search page from another page:

  1. If the URL contains namespace ids, these namespaces will be preselected.
  2. If the user has namespace preferences set, they will be preselected
  3. The main namespace will be preselected.

The option to define namespaces selection via URL might be even more complicated if we consider T187911: Fallback namespaces are what has been defined in user preferences - what happens if the "All" preset is deselected, causing the form to fall back to some "default" state. When we have 3 possible defaults, which one will it be?

Aklapper renamed this task from Advanced Search incompatible with InputBox-Extension to Advanced Search incompatible with InputBox extension.Feb 22 2018, 2:42 PM

I talked to @Lea_WMDE and these are our thoughts on your points:

  1. If the URL contains namespace ids, these namespaces will be preselected.

This is what we'd like to happen

  1. If the user has namespace preferences set, they will be preselected

This should only happen when there's nothing else selected, so if point 1 is valid then the default selection is ignored.

  1. The main namespace will be preselected.

This would happen when neither of the first two points are valid so no preselection from either preferences or somewhere else. Also some wikis have multiple namespaces set as default like commons for example so we should talk about default namespaces and not the main namespace.

Screenshot_20180226_122958.png (508×1 px, 49 KB)

there will be an extra ticket for this behavior.

The option to define namespaces selection via URL might be even more complicated if we consider T187911: Fallback namespaces are what has been defined in user preferences - what happens if the "All" preset is deselected, causing the form to fall back to some "default" state. When we have 3 possible defaults, which one will it be?

There is a ticket for this which the UX-Team currently works on.

Lea_WMDE triaged this task as Medium priority.Feb 26 2018, 11:45 AM
Lea_WMDE updated the task description. (Show Details)
Lea_WMDE moved this task from Backlog to Tickets ready for pickup on the Advanced-Search board.
Lea_WMDE set the point value for this task to 3.
Lea_WMDE moved this task from Tickets ready for pickup to In FUN sprint on the Advanced-Search board.
Lea_WMDE renamed this task from Advanced Search incompatible with InputBox extension to Namespace parameters in the url should be shown in the namespace bar.Mar 7 2018, 1:24 PM
gabriel-wmde moved this task from Doing to Review on the wmde-fundraising-sprint-19 board.

Change 419743 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/AdvancedSearch@master] Respect ns… parameters when no namespace state is available

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

Change 413365 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Allow URL preselection of namespaces

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

Change 419743 merged by jenkins-bot:
[mediawiki/extensions/AdvancedSearch@master] Respect ns… parameters when no namespace state is available

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