Last modified: 2014-01-05 05:48:03 UTC
ve.init.mw.Platform.js currently hard-codes searching from Commons, even if the wiki doesn't actually load images from Commons. We should do this based on wiki config instead.
Ideally we'd avoid hardcoding Commons entirely and instead of exporting isInstantCommons, we'd export fileRepos. That should be almost as easy to do and would fix other things as well: * Wikis where their repo is Commons but through their own wgForeignFileRepos setting (e.g. like on WMF where we use more fine-tuned configuration that does essentially the same, or wikis that configure it but don't use wgUseInstantCommons because they want to set different parameters (e.g. disable repo[fetchDescription] or use a non-default repo[cacheExpiry]). * Wikis with more than 2 repositories. * Wikis working with other repos (e.g. a wiki farm might have their own commons-like thing). Especially reason #1 since we do use InstantCommons in production but not the default settings through the UseInstantCommons toggle. We could hardcode some detection and export "isUsingCommonsAsARepoSomehow", but might as well take a few more minutes and figure out how to just export an array of api urls. [] https://www.mediawiki.org/wiki/Manual:$wgUseInstantCommons#Details
(In reply to comment #1) > Ideally we'd avoid hardcoding Commons entirely and instead of exporting > isInstantCommons, we'd export fileRepos. Indeed; that was what I was thinking when I wrote this bug. Title modified to be clearer.
This was very frustrating for my work's internal wiki. First, I didn't want any Instant Common images (and thanks to James, I was able to remove the line of code). However, since I disabled the use of Instant Commons ($wgUseInstantCommons = false;), I was still able to search through the Instant Commons but after saving, everything showed up as a broken link. Suggestion: - Tie the JSON mediaSources object in ve.init.ms.Platform.js to the $wgUseInstantCommons (i.e., if Commons is turned off in LocalSettings.php, then a user can't search through the images).
This can now be done by using the new meta=filerepoinfo API query, which was introduced into core in Gerrit change #85344.
Change 102377 had a related patch set uploaded by Mooeypoo: Use image sources from API's fileRepo https://gerrit.wikimedia.org/r/102377
Change 102377 merged by jenkins-bot: Use image sources from the fileRepo API https://gerrit.wikimedia.org/r/102377