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

We should make sure it's fixed before the release

We should make sure it's fixed before the release

And (relatively) soon :-).

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 subscribed.

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: 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?

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 );
} )

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.

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.

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.)

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

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 ~]$

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.

Thanks to those who spent time on fixing this.

Restricted Application added a subscriber: Ericliu1912. ยท View Herald TranscriptAug 13 2022, 1:53 PM