Last modified: 2014-01-15 20:34:36 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 T61863, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59863 - Links to the foreign repository pictures use local wiki and not foreign repo file namespace
Links to the foreign repository pictures use local wiki and not foreign repo ...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
MultimediaViewer (Other open bugs)
unspecified
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, i18n
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-09 10:33 UTC by Dereckson
Modified: 2014-01-15 20:34 UTC (History)
4 users (show)

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


Attachments

Description Dereckson 2014-01-09 10:33:33 UTC
[ Bug symptoms ]

As highlighted on https://www.mediawiki.org/wiki/Talk:Multimedia/About_Media_Viewer#On_Wikipedia.2C_links_don.27t_go_to_Commons, the link to the file on Commons contained twice the file namespace.

For example, [[File:Quux.jpg]] linked to http://commons.wikimedia.org/wiki/File:File:Quux.jpg

This has been fixed, writing once the namespace. So for en. File:File: became File: and all is fine.

But in other MediaWiki languages, the link were:
http://commons.wikimedia.org/wiki/File:Fichier:Quux.jpg

And is now:
http://commons.wikimedia.org/wiki/Fichier:Quux.jpg

But it should be:
http://commons.wikimedia.org/wiki/File:Quux.jpg

Thank you to Okki for reporting this.


[ Bug analysis ]

In ext.multimediaViewer.lightboxinterface.js, LIP.setFilePageLink:

For Commons as foreign repo, linkpath = repoInfo.server + repoInfo.articlepath
repoInfo.articlepath is /wiki/$1, $1 being substituted by fileTitle.getPrefixedText().

Instead, $1 should be replaced by repofileNameSpace + ":" + fileTitle.getMain().

Where repofileNameSpace is the file namespace on the foreign repo.
Comment 1 Mark Holmquist 2014-01-09 17:13:31 UTC
Oh. Hm.

There's not currently any way to get the name of the file namespace on the foreign host.

So...

I guess we can write this support into core, but it will take a while to review and push out.

Yay, core bugs!
Comment 2 Mark Holmquist 2014-01-09 17:15:29 UTC
Oh, wait. We don't need to make this complicated, because we have the descriptionurl element of the API response. That seems way easier.

I'll mark this easy - take the big complicated link construction code, delete most of it, and use innerInfo.descriptionurl instead.

Thanks, Dereckson!
Comment 3 Dereckson 2014-01-15 20:34:36 UTC
This has been fixed by change Ife8293c86683ea914b1a5a60000584b501d92e55.

This change introduced another bug, bug 60099.

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


Navigation
Links