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
Restricted Application added a project: User-Urbanecm. · View Herald TranscriptJul 13 2020, 10:52 AM
Tarrow added a subscriber: Tarrow.

We should make sure it's fixed before the release

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

We should make sure it's fixed before the release

And (relatively) soon :-).

He7d3r added a subscriber: He7d3r.Jul 14 2020, 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!.EditedJul 15 2020, 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.Jul 15 2020, 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.Jul 15 2020, 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.Jul 18 2020, 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 );
} )
alaa added a subscriber: alaa.Jul 18 2020, 11:54 AM
stjn added a subscriber: stjn.Jul 19 2020, 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.Jul 19 2020, 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.Jul 19 2020, 10:47 AM
PiotrekD added a comment.EditedJul 19 2020, 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.EditedJul 19 2020, 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.Jul 21 2020, 8:40 PM
Yupik added a subscriber: Yupik.Jul 22 2020, 3:25 AM
jhsoby added a subscriber: jhsoby.Jul 24 2020, 10:28 AM
Eihel added a subscriber: Eihel.Jul 26 2020, 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.EditedJul 27 2020, 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.Jul 28 2020, 2:27 PM
Urbanecm closed this task as Resolved.Jul 28 2020, 7:18 PM
Shizhao moved this task from Extensions to Closed on the Chinese-Sites board.Jul 29 2020, 2:39 AM
matmarex added a subscriber: matmarex.