The sorting of the interwikis in Wikipedia is broken, e.g. at https://de.wikipedia.org/wiki/Hamburg. It is no longer alphabetical.
Description
Details
Related Objects
- Mentioned In
- T253764: Undeploy the InterwikiSorting extension from Wikipedia production
T257684: Make TermSearchInteractorFactory wiring use TermStoreDelegatingMatchingTermsLookup
T256668: 1.35.0-wmf.40 deployment blockers - Mentioned Here
- rEIWSc5f6c97856a5: Use LanguageLinksHook to sort interwiki links
T253764: Undeploy the InterwikiSorting extension from Wikipedia production
Event Timeline
Tagging CPT given it involves MediaWIki core. CCing @tstarling, because it involves the Hooks system, and it is an unintended side effect.
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?
@Ankry: You can still reach all links, all links are working. This inconvenience clearly does not qualify as "Unbreak now".
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 ); } )
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.
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?
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
Change 612155 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@master] Use LanguageLinksHook to sort interwiki links
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
Change 616504 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@wmf/1.36.0-wmf.1] Use LanguageLinksHook to sort interwiki links
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 ~]$
Change 616607 had a related patch set uploaded (by Ladsgroup; owner: Urbanecm):
[mediawiki/extensions/InterwikiSorting@REL1_35] Use LanguageLinksHook to sort interwiki links
Change 616607 merged by jenkins-bot:
[mediawiki/extensions/InterwikiSorting@REL1_35] Use LanguageLinksHook to sort interwiki links