Page MenuHomePhabricator

MediaSearch not compatible with new WVUI search widget on Wikimedia Commons
Closed, ResolvedPublic2 Estimated Story Points

Description

During deployment of T287215, we noticed that search results were not taking the user to Special:MediaSearch and were instead taking the user to Special:Search.

It does this by adding a hidden field <input type="hidden" name="title" value="Special:MediaSearch"> via this hook:
https://gerrit.wikimedia.org/g/mediawiki/extensions/MediaSearch/+/939b5861410f3528501604064ab536eed33d5c0e/src/MediaSearchHooks.php#51

The code in Vector doesn't seem to be passing this page title to the WVUI widget.

Developer notes

Use the urlGenerator property in https://doc.wikimedia.org/wvui/master/ui/?path=/story/components-typeaheadsearch--configurable to pass the title to the WVUI widget.

For testing purposes use the following hook:

$wgHooks['BeforePageDisplay'][] = function ( $out, $skin ) {
	$skin->setSearchPageTitle( Title::newFromText('Special:MediaSearch') );
  };
  • To fix this WVUI will need to accept a searchPageTitle parameter to allow us to customize Special:Search with Special:MediaSearch
  • A patch in Vector will make use of it (which will be blocked on a release)

QA Results - Beta

ACStatusDetails
1T287540#7332720

QA Results - Prod

ACStatusDetails
1T287540#7332739

Event Timeline

Jdlrobson triaged this task as Medium priority.
Jdlrobson created this task.

Change 708553 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[wvui@master] It should be possible to use something other than Special:Search

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

Jdlrobson added a subscriber: egardner.

@egardner given the overlap between our projects could I request a review on the WVUI side of this?

Change 708561 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Use the search title if configured

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

@egardner given the overlap between our projects could I request a review on the WVUI side of this?

@Jdlrobson: @egardner is out this week; do you need review before he's back? if so I'll ask some others on the SD team.

@CBogen the change is relatively simple. if this week is possible and anyone is familiar with Vue.js that would be ideal. Perhaps the only thing that might happen in review is a bike shed over the name :)

Change 708553 merged by jenkins-bot:

[wvui@master] It should be possible to use something other than Special:Search

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

Thanks for the help structured data, we can take it from here with help from the Vue.js migration team!

Change 708561 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Use the search title if configured

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

This is now just blocked on the next WVUI release.

Change 715153 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update WVUI to v0.3.0

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

Change 715153 merged by jenkins-bot:

[mediawiki/core@master] Update WVUI to v0.3.0

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

Change 716527 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Do not hard code Special:Search

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

Change 716527 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Do not hard code Special:Search

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search results on commons should direct the user to Special:MediaSearch

Screen Recording 2021-09-03 at 8.08.30 PM.mov.gif (522×1 px, 442 KB)

Test Result - Prod

Status: ✅ PASS
Environment: commons
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

✅ AC1: Search results on commons should direct the user to Special:MediaSearch

Screen Recording 2021-09-03 at 8.58.59 PM.mov.gif (522×1 px, 490 KB)

Edtadros updated the task description. (Show Details)
Edtadros added a subscriber: Edtadros.