Last modified: 2013-04-22 16:15:14 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 T26502, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24502 - Multiple langlinks to same language cause database conflicts
Multiple langlinks to same language cause database conflicts
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.18.x
All All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-22 21:03 UTC by Nikola Smolenski
Modified: 2013-04-22 16:15 UTC (History)
12 users (show)

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


Attachments

Description Nikola Smolenski 2010-07-22 21:03:39 UTC
If an article has multiple interwiki links to the same language, they are properly displayed in the list of languages, but only one of them is displayed in the API. Steps to reproduce:

1) Go to http://en.wikipedia.org/wiki/Open_source . If no one changed the article, there should be two interwiki links to Sorani Wikipedia (language code csb): سەرچاوە کراوە and ژێدەرکراوە.

2) Go to http://en.wikipedia.org/w/api.php?action=query&prop=langlinks&lllimit=500&titles=Open_source . There is only one link to ژێدەرکراوە, the other link is not in the list.
Comment 1 Roan Kattouw 2010-07-23 06:03:02 UTC
The culprit is in the database:

CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);

This says the combination of (page, language) is unique, but in the case you demonstrated it isn't. Should be changed to:

CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang, ll_title);

and the code updated accordingly (both in the API and in the rest of core).
Comment 2 Nikola Smolenski 2011-03-27 09:28:15 UTC
A related problem is that LinksUpdate class doesn't support more than one link per language too.
Comment 3 Tim Starling 2011-04-05 06:28:49 UTC
Why do you want more than one link per language?
Comment 4 Nikola Smolenski 2011-04-05 07:05:24 UTC
It's not that I particularly want it, it's a MediaWiki feature. As to why the feature is needed, all philosophy aside, for example:

* There are heaps of articles for which everyone agrees that they should be merged, such as http://en.wikipedia.org/wiki/Category:Articles_to_be_merged_from_May_2008 , and until merged other wikis should logically have interlanguage links to both articles.

* One Wikisource text may have more than one translation in another Wikisource, and both translations should have interlanguage links.

Possibly this feature isn't as often used because bots go crazy when they see it.

And I don't think it's as simple as a database update. LinksUpdate::getExistingInterlangs() would have to be reworked to work similarly to LinksUpdate::getExistingInterwikis(), and then everything that depends on it would have to be reworked too...
Comment 5 Tim Starling 2011-04-05 07:21:46 UTC
(In reply to comment #4)
> It's not that I particularly want it, it's a MediaWiki feature. As to why the
> feature is needed, all philosophy aside, for example:
> 
> * There are heaps of articles for which everyone agrees that they should be
> merged, such as
> http://en.wikipedia.org/wiki/Category:Articles_to_be_merged_from_May_2008 , and
> until merged other wikis should logically have interlanguage links to both
> articles.
> 
> * One Wikisource text may have more than one translation in another Wikisource,
> and both translations should have interlanguage links.

Having two links labelled "English" doesn't seem like a good way to fix either of those things. What you want is a sublist, like:

* Français
* English
  * Rollatini
  * Braciola

It should be good enough to use the names of the articles as the link labels in the sublist, then you don't have to add fields or change the invocation syntax or anything. 

This is not a blocker for bug 15607.
Comment 6 Siebrand Mazeland 2011-04-05 07:26:16 UTC
I think allowing multiple interlanguage links on one page should be considered a bug. That makes this issue obsolete.
Comment 7 Siebrand Mazeland 2011-04-05 07:26:49 UTC
(In reply to comment #6)
> I think allowing multiple interlanguage links on one page should be considered
> a bug. That makes this issue obsolete.

Should of course be: I think allowing multiple interlanguage links *to the same language* on one page should be considered a bug. That makes this issue obsolete.
Comment 8 Tim Starling 2011-04-05 07:29:59 UTC
It's certainly a bug that LinksUpdate will try to add duplicate links to the langlinks table on every edit, and fail each time due to index conflicts. It should either work nicely or not work at all.
Comment 9 Krinkle 2011-04-05 12:31:26 UTC
Changing bug meta data accordingly.
Comment 10 Nikola Smolenski 2011-04-05 17:37:47 UTC
I disagree that multiple interlanguage links to the same language on one page should be considered a bug, since there are use cases where that is preferable. But OK, I'll redo the Interlanguage extension without full support for this, and if it is needed somewhere people could continue to use the raw interlanguage links.
Comment 11 John Mark Vandenberg 2011-05-07 03:21:29 UTC
(In reply to comment #5)
> (In reply to comment #4)
> >..
> > * One Wikisource text may have more than one translation in another Wikisource,
> > and both translations should have interlanguage links.
> 
> Having two links labelled "English" doesn't seem like a good way to fix either
> of those things. What you want is a sublist, like:
> 
> * Français
> * English
>   * Rollatini
>   * Braciola
> 
> It should be good enough to use the names of the articles as the link labels in
> the sublist, then you don't have to add fields or change the invocation syntax
> or anything. 
> 
> This is not a blocker for bug 15607.

English wikisource currently does this using JavaScript.
http://en.wikisource.org/wiki/Template:Interwiki-info
http://en.wikisource.org/wiki/The_Raven_%28Poe%29
see function interwikiExtra() in
http://en.wikisource.org/wiki/MediaWiki:Common.js
Comment 12 Umherirrender 2012-08-06 22:18:35 UTC
Comitted a patch with Gerrit change #17912 to avoid the database conflict.
Comment 13 Umherirrender 2012-09-26 08:11:05 UTC
Tim commited a patch with Gerrit change #25232 to avoid having multiple languange links to the same language
Comment 14 Umherirrender 2012-10-05 19:24:24 UTC
Gerrit change #25232 merged, with makes this bug LATER.

When a other status is better, please change. Thanks.

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


Navigation
Links