Page MenuHomePhabricator

Interwiki sorting broken
Closed, ResolvedPublic

Description

The sorting of the interwikis in Wikipedia is broken, e.g. at https://de.wikipedia.org/wiki/Hamburg. It is no longer alphabetical.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 612155 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/InterwikiSorting@master] Use new ReorderInterwikiLinksHook for changing interwiki order

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

Restricted Application added a project: User-Urbanecm. · View Herald TranscriptMon, Jul 13, 10:52 AM
Tarrow added a subscriber: Tarrow.

We should make sure it's fixed before the release

Komischn removed a subscriber: Komischn.Mon, Jul 13, 3:21 PM
Urbanecm triaged this task as High priority.Mon, Jul 13, 6:33 PM

We should make sure it's fixed before the release

And (relatively) soon :-).

He7d3r added a subscriber: He7d3r.Tue, Jul 14, 10:43 AM
Urbanecm added a subscriber: tstarling.

Tagging CPT given it involves MediaWIki core. CCing @tstarling, because it involves the Hooks system, and it is an unintended side effect.

Ankry raised the priority of this task from High to Unbreak Now!.EditedWed, Jul 15, 4:06 PM
Ankry added a subscriber: Ankry.

Broken on all wikis, no workaround, multiple complants from users on IRC. Maybe the change that introduced the bug should be reverted if no chance for quick fix deployment?

Aklapper lowered the priority of this task from Unbreak Now! to High.Wed, Jul 15, 7:01 PM

@Ankry: You can still reach all links, all links are working. This inconvenience clearly does not qualify as "Unbreak now".

Ankry added a comment.Wed, Jul 15, 8:14 PM

@Ankry: You can still reach all links, all links are working. This inconvenience clearly does not qualify as "Unbreak now".

Links exists. But an average user cannot find them.

Broken on all wikis, no workaround, multiple complants from users on IRC. Maybe the change that introduced the bug should be reverted if no chance for quick fix deployment?

The change that introduced this was the migration to the new hooks system, which cannot now be reverted

Maybe we can come up with a nasty hack to make it working again and discuss a cleaner solution afterwards?

Meno25 added a subscriber: Meno25.Sat, Jul 18, 9:43 AM

Temp hack deployed on plwiki (diff):

$( function () {
	var $ul = $( '#p-lang ul' );
	
	$ul.children().sort( function ( a, b ) {
		return a.classList[ 1 ].localeCompare( b.classList[ 1 ] );
	} ).appendTo( $ul );
} )
stjn added a subscriber: stjn.Sun, Jul 19, 10:07 AM

Temp hack deployed on plwiki (diff)

If anyone intends to use this, please consider putting it to MediaWiki:Group-user.js instead of MediaWiki:Common.js, since anonymous readers would have compact interwiki list anyway.

(...) since anonymous readers would have compact interwiki list anyway.

That's not true on plwiki and perhaps other wikis, too. In any case, sorting is broken regardless of compact ULS being enabled or not.

stjn added a comment.Sun, Jul 19, 10:32 AM

That's not true on plwiki and perhaps other wikis, too. In any case, sorting is broken regardless of compact ULS being enabled or not.

Sure, but that’s only because plwiki for some reason disabled compact ULS via a CSS gadget (loaded in MediaWiki:Common.js) to anonymous users. I doubt anyone else repeated this strange hack.

Srdjan added a subscriber: Srdjan.Sun, Jul 19, 10:47 AM
PiotrekD added a comment.EditedSun, Jul 19, 10:52 AM

That's not true on plwiki and perhaps other wikis, too. In any case, sorting is broken regardless of compact ULS being enabled or not.

Sure, but that’s only because plwiki for some reason disabled compact ULS via a CSS gadget (loaded in MediaWiki:Common.js) to anonymous users. I doubt anyone else repeated this strange hack.

I prefer to have all interwikis sorted than some interwikis without any order.

Anyway, Peter Bowman's hack works both on wikis with compact ULS and on those without it. (I've just pasted the hack into the JS console of my browser on a few pages on en.wiki to check this.)

Paracel63 added a comment.EditedSun, Jul 19, 1:13 PM

Bowman's hack also added to MediaWiki:Common.js at svwp as well, and with success. Don't understand the MediaWiki:Group-user.js comment; shouldn’t anonymous users have alphabetical (short) lists as well? Is there an overhead to take into account?

Is there an overhead to take into account?

Every bit of JavaScript is an overhead: its code has to be loaded (more bytes to transmit) and run (more statements to execute). Also changing MediaWiki:Common.js means that it falls out of cache and needs to be downloaded again. The impact of these is low, but not zero, so it should be considered, especially thinking of people with limited data plans.

A greater issue with @PeterBowman’s hack is that it ignores $wgInterwikiSortingSort and $wgInterwikiSortingSortPrepend configuration variables (documentation), so anyone adopting it should take their wiki’s sorting customs into account.

Change 612153 abandoned by Urbanecm:
[mediawiki/core@master] Define ReorderInterwikiLinksHook

Reason:
okay, let's not do another hook thing

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

Wargo added a subscriber: Wargo.Tue, Jul 21, 8:40 PM
Yupik added a subscriber: Yupik.Wed, Jul 22, 3:25 AM
jhsoby added a subscriber: jhsoby.Fri, Jul 24, 10:28 AM
Eihel added a subscriber: Eihel.Sun, Jul 26, 9:02 AM

Change 612155 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@master] Use LanguageLinksHook to sort interwiki links

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

Change 616504 had a related patch set uploaded (by Urbanecm; owner: Urbanecm):
[mediawiki/extensions/InterwikiSorting@wmf/1.36.0-wmf.1] Use LanguageLinksHook to sort interwiki links

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

Change 616504 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@wmf/1.36.0-wmf.1] Use LanguageLinksHook to sort interwiki links

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

Mentioned in SAL (#wikimedia-operations) [2020-07-27T20:41:23Z] <urbanecm@deploy1001> Synchronized php-1.36.0-wmf.1/extensions/InterwikiSorting/: c5f6c97856a5dbe673064afd2804bebb9b787580: Use LanguageLinksHook to sort interwiki links (T257625) (duration: 00m 59s)

So, this is done now. We should clean temporary javascript hacks that were introduced. This task is mentioned in the following:

[urbanecm@mwmaint1002 ~]$ mwgrep 'T257625'
bswiki              MediaWiki:Group-user.js
cawiki              MediaWiki:Group-user.js
elwiki              MediaWiki:Common.js
hrwiki              MediaWiki:Group-user.js
nowiki              MediaWiki:Common.js
plwiki              MediaWiki:Common.js
plwikisource        MediaWiki:Common.js
svwiki              MediaWiki:Group-user.js

(total: 8, shown: 8)
[urbanecm@mwmaint1002 ~]$
Izno added a comment.EditedMon, Jul 27, 9:39 PM

This one might be a good one to backport to 1.35...

Change 616607 had a related patch set uploaded (by Ladsgroup; owner: Urbanecm):
[mediawiki/extensions/InterwikiSorting@REL1_35] Use LanguageLinksHook to sort interwiki links

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

This one might be a good one to backport to 1.35...

Done

Change 616607 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@REL1_35] Use LanguageLinksHook to sort interwiki links

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

So, this is done now. We should clean temporary javascript hacks that were introduced. This task is mentioned in the following:

[urbanecm@mwmaint1002 ~]$ mwgrep 'T257625'
bswiki              MediaWiki:Group-user.js
cawiki              MediaWiki:Group-user.js
elwiki              MediaWiki:Common.js
hrwiki              MediaWiki:Group-user.js
nowiki              MediaWiki:Common.js
plwiki              MediaWiki:Common.js
plwikisource        MediaWiki:Common.js
svwiki              MediaWiki:Group-user.js

(total: 8, shown: 8)
[urbanecm@mwmaint1002 ~]$

I have removed those scripts.

We should announce it is fixed now.

Thanks to those who spent time on fixing this.

MBH removed a subscriber: MBH.Tue, Jul 28, 2:27 PM
Urbanecm closed this task as Resolved.Tue, Jul 28, 7:18 PM
Shizhao moved this task from Extensions to Closed on the Chinese-Sites board.Wed, Jul 29, 2:39 AM
matmarex added a subscriber: matmarex.