Last modified: 2014-01-05 05:48:03 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T52673, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 50673 - VisualEditor: Search for images from fileRepos, rather than hard-coding use of local and Commons
VisualEditor: Search for images from fileRepos, rather than hard-coding use o...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Low minor
: VE-deploy-2014-01-09
Assigned To: Moriel Schottlender
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-03 15:27 UTC by James Forrester
Modified: 2014-01-05 05:48 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description James Forrester 2013-07-03 15:27:49 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.
Comment 1 Krinkle 2013-07-18 12:32:13 UTC
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
Comment 2 James Forrester 2013-07-18 14:16:41 UTC
(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.
Comment 3 Michael Humphreys 2013-09-25 00:08:15 UTC
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).
Comment 4 James Forrester 2013-10-02 23:50:56 UTC
This can now be done by using the new meta=filerepoinfo API query, which was introduced into core in Gerrit change #85344.
Comment 5 Gerrit Notification Bot 2013-12-18 02:37:14 UTC
Change 102377 had a related patch set uploaded by Mooeypoo:
Use image sources from API's fileRepo

https://gerrit.wikimedia.org/r/102377
Comment 6 Gerrit Notification Bot 2014-01-05 05:47:19 UTC
Change 102377 merged by jenkins-bot:
Use image sources from the fileRepo API

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links