Page MenuHomePhabricator

[M] [SPIKE] Investigate how easy/hard it is to make MediaSearch usable on other wikis
Open, Needs TriagePublic

Description

On the surface, it looks like if the tab order and tab names were configurable, then non-commons wikis could make use of the MediaSearch extension

This ticket is to investigate

  • the level of effort in making the order/tab names configurable
  • to see if the media searches will work (via falling back to commons) even on wikis with few local files
    • also see if the local files are prioritised in the search results
    • also worth checking how the search indices are used if/when there is a fallback (lower priority)

Event Timeline

CBogen renamed this task from [SPIKE] Investigate how easy/hard it is to make MediaSearch usable on other wikis to [M] [SPIKE] Investigate how easy/hard it is to make MediaSearch usable on other wikis.Apr 21 2021, 4:42 PM

Notes - WIP

Local & Shared respository

  • Media search will fall back and show commons files both using search box and using url string
  • The imageinfo results differ from commons than on other wikis. Shared respository files not have "page id's" nor any unique identifier (bar file name) and I think this is what breaks QuickView. We would need to make tweaks to extmetadata. MediaSearch probably also needs to differentiate between local and shared repository files.

Tab order

Namespace (Filter names) Broken

  • We are pulling the namespaces names etc. locally. for the filters and should work on all wikis.
  • Vue is unfortunately broken here and haven't been able to confirm the filter is working as expected.

RangeError: Incorrect locale information provided

at Number.toLocaleString (<anonymous>)
at VueComponent.resultsCount ()
		resultsCount: function () {
			return this.$i18n(
				'mediasearch-results-count',
				this.totalHits[ this.mediaType ].toLocaleString( mw.config.get( 'wgUserLanguage' ) )
			);
		},

Seems we are assuming the value of mw.config.get('wgUserLanguage') is always going to be a valid arg for toLocaleString(). Unfortunately test wiki is returning:

mw.config.get('wgUserLanguage')
"test"

Other files Broken

  • Same problem as above.

Design thoughts or questions

  • Consider identifying to user in some way if files are local or in a shared repository?
  • Prioritising or separating out mainspace (articles)?

Change 697694 had a related patch set uploaded (by Seddon; author: Seddon):

[operations/mediawiki-config@master] Investigate MediaSearch usability on other wikis

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

Change 697694 merged by jenkins-bot:

[operations/mediawiki-config@master] Investigate MediaSearch usability on other wikis

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

Mentioned in SAL (#wikimedia-operations) [2021-06-02T11:06:33Z] <urbanecm@deploy1002> Synchronized wmf-config/InitialiseSettings.php: f12e368481b6836eefa070ad5dcf52af3f39d479: Investigate MediaSearch usability on other wikis (T278984) (duration: 00m 57s)