Page MenuHomePhabricator

Add option to disable Wikibase’ custom search box
Closed, ResolvedPublic3 Story Points

Description

As a wiki administrator, I want to be able to install Wikibase on an existing wiki without disturbing its current users.

Problem:
Wikibase unconditionally overrides MediaWiki’s standard search box with a custom search box that only searches items. That’s fine for Wikidata, and for other wikis where the Wikibase repository is the main functionality, but it’s a problem if there’s also other interesting stuff on the wiki, as on the OpenStreetMap wiki where @Yurik recently set up Wikibase.

Acceptance criteria:

  • There is an option to disable the custom search box and leave the standard search box in place.

Workaround
This is a super ugly hack, but it works, at least on my local wiki:

LocalSettings.php
// add this after the Wikibase extension is loaded
$wgResourceModules['wikibase.ui.entitysearch']['scripts'] = [];

However, this may not be possible in more complicated setups, depending on how settings are loaded there.

Implementation note:
The search box is implemented in the wikibase.ui.entitysearch ResourceLoader module, which is added to output pages in the RepoHooks::onBeforePageDisplay function. Presumably it shouldn’t be too difficult to make that hook handler check for a config variable.

It should be noted alongside the config var that it is intended to be removed once T190454 is resolved.

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterAdd option to disable entity search UI

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 26 2018, 5:35 PM
Yurik added a comment.EditedSep 26 2018, 5:44 PM

See also community discussion thread (update link fixed)

Do I understand this right that is is for the case when a) Main namespace is not an entity namespace and b) you do not want the search box to actually search entity namespaces?

T190454: Display entity & article namespace completion search together should of course solve this but I feel it's long way to go so an option to remove the override is a plus. Fulltext search in entities will still work.

Yurik added a comment.Sep 26 2018, 7:28 PM

@Smalyshev correct. Ideally we should have T190454, but unless we want to stop using wikibase until it is ready, this is a good interim solution.

Addshore updated the task description. (Show Details)
Addshore set the point value for this task to 3.
Addshore moved this task from Ready to estimate to In Progress on the Wikidata-Campsite board.
Addshore triaged this task as Medium priority.Oct 2 2018, 1:38 PM
Addshore moved this task from incoming to in progress on the Wikidata board.Oct 9 2018, 9:36 AM

Change 469872 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Add option to disable entity search UI

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

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptOct 26 2018, 12:49 PM

Change 469872 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add option to disable entity search UI

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