Page MenuHomePhabricator

www.wikipedia.org: prefilling the search box with the "search" URL parameter does not work
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

What should have happened instead?:

  • The search input contains "Does-not-exist"

Story:
When www.wikipedia.org is opened, the page should evaluate for the presence of the url query parameter <code>search</code>. If this url query parameter is present, then retrieve its value and profile the search field of www.wikipedia.org with this value.

It also needs to avoid security problems, as it takes user input from a potentially untrusted location (the url address), by applying the proper escaping at the proper places.

Event Timeline

Punith.nyk updated Other Assignee, added: Punith.nyk.
Punith.nyk updated Other Assignee, removed: Punith.nyk.

Change 910462 had a related patch set uploaded (by Punith.nyk; author: Punith.nyk):

[wikimedia/portals@master] Make www.wikipedia.org: prefilling the search box with the "search" URL parameter work

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

TheDJ subscribed.

@Punith.nyk I have update the ticket with a more exact description of the work that is required.

Change 910462 abandoned by Aklapper:

[wikimedia/portals@master] Make www.wikipedia.org: prefilling the search box with the "search" URL parameter work

Reason:

I don't see how it helps anybody ever to prefill their search box with "Does-not-exist". Not sure why this patch was created and proposed?

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

Change 910766 had a related patch set uploaded (by Punith.nyk; author: Punith.nyk):

[wikimedia/portals@master] Make www.wikipedia.org: prefilling the search box with the "search" URL parameter work

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

This problem has just been pointed out again. On dewiki, we always provide a link to searching other language versions in the Search menu. Similarly, we provide this link in the Newarticletext. These links always use the URL parameter ?search=, but it seems to have no effect. Is this the intention? And if so, why? Users expect to have the search form prefilled when they click those links.

simon04 removed Punith.nyk as the assignee of this task.EditedOct 4 2024, 10:45 AM
simon04 added projects: SRE, ops-eqiad.
simon04 added a subscriber: Punith.nyk.

@TheDJ in https://gerrit.wikimedia.org/r/910766

Additionally, I noticed that the webserver for the portals currently seems to actively strip the query parameters, so even after this is implemented, some server configuration change might be required.

This.

The code for parsing ?search=... is already in place, see https://gerrit.wikimedia.org/r/plugins/gitiles/wikimedia/portals/+/refs/heads/master/src/common/assets/js/wm-portal.js#184 (Prefills the search box with the "search" URL parameter)

Change #1080357 had a related patch set uploaded (by Simon04; author: Simon04):

[operations/puppet@production] Revert "wwwportals: clean up query string on www.wikipedia.org"

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

Change #1080357 merged by Ladsgroup:

[operations/puppet@production] www.wikipedia.org: fix "search" URL parameter

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

Pcoombe assigned this task to simon04.

search is working again, thanks! I'm pretty sure the uselang part has never actually done anything, hence T364348: Ability to set language when viewing a portal (ie. wikipedia.org) page. At the moment it just defaults to the user's primary browser language, which seems fine for the de.wikipedia use case

Yay, the regression is fixed after 2.5 years (2022-07-20).

@XanonymusX, I think we should celebrate in Innsbruck! 🎉
@TheDJ, @Ladsgroup, et al., I think we should celebrate in Istanbul! 🎉

Great news indeed! Hope we have a chance to celebrate soon :)

elukey subscribed.

Hi folks! I am really sorry to ruin the mood but https://gerrit.wikimedia.org/r/c/operations/puppet/+/1080357 was reverted, it caused an issue with endless HTTP 301 redirects for www.wikipedia.org (keep redirecting to www.wikipedia.org/).

More info in https://phabricator.wikimedia.org/T387549

Change #1123622 had a related patch set uploaded (by Simon04; author: Simon04):

[operations/puppet@production] www.wikipedia.org: fix "search" URL parameter

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

Gehel moved this task from needs triage to watching / waiting on the Discovery-Search board.
Gehel subscribed.

We're not expecting the Search Platform team to do any work on this.

Even better, thank you! Sorry for the noise!

We may do it at the end of that window or right after due to meetings conflicts, but it should happen on Wednesday :D

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:11:50Z] <claime> Disabling puppet on deploy1003 - T318285

Change #1123622 merged by Clément Goubert:

[operations/puppet@production] www.wikipedia.org: fix "search" URL parameter

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

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:14:08Z] <claime> Enabling puppet on deploy1003 - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:14:27Z] <claime> Running puppet on deploy1003 - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:19:07Z] <claime> Running httpbb tests on deploy1003 before deploying apache change, should fail - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:22:08Z] <cgoubert@deploy1003> Started scap sync-world: T318285 - 1123622 - www.wikipedia.org: fix search URL parameter

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:26:47Z] <cgoubert@deploy1003> cgoubert: T318285 - 1123622 - www.wikipedia.org: fix search URL parameter synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:26:51Z] <claime> Running httpbb tests on deploy1003 before deploying apache change, should pass - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:39:03Z] <claime> Running puppet on cumin1002 to deploy new httpbb tests - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:41:47Z] <cgoubert@deploy1003> Finished scap sync-world: T318285 - 1123622 - www.wikipedia.org: fix search URL parameter (duration: 20m 34s)

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:42:47Z] <claime> Running new httpbb tests on cumin1002 - T318285

Mentioned in SAL (#wikimedia-operations) [2025-03-26T11:45:49Z] <claime> New httpbb tests on cumin1002 green - T318285

The search box now populates correctly. Question left is, should uselang=de change the language dropdown of the search box? Right now it does not.