jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/372417 )

Change subject: Preserve array keys (language keys) when sorting the language 
dropdown
......................................................................


Preserve array keys (language keys) when sorting the language dropdown

This caused UploadWizard to generate wikitext like '{{83|...}}'
(with different numbers) instead of '{{en|...}}' in file descriptions.
Follow-up to e9e2a14da619658cd2695b80ef199dafa7e7a0a7.

Bug: T173522
Change-Id: I25dd0b4d1481c6f6ef1acb63179c52218a0066b3
---
M UploadWizard.config.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/UploadWizard.config.php b/UploadWizard.config.php
index c10134b..cc9c3f6 100644
--- a/UploadWizard.config.php
+++ b/UploadWizard.config.php
@@ -10,7 +10,7 @@
 $userLangCode = $wgLang->getCode();
 // We need to get a list of languages for the description dropdown.
 // Increase the number below to invalidate the cache if this code changes.
-$cacheKey = wfMemcKey( 'uploadwizard', 'language-templates2', $userLangCode );
+$cacheKey = wfMemcKey( 'uploadwizard', 'language-templates3', $userLangCode );
 // Try to get a cached version of the list
 $uwLanguages = $wgMemc->get( $cacheKey );
 // Commons only: ISO 646 code of Tagalog is 'tl', but language template is 
'tgl'
@@ -66,7 +66,7 @@
        // Sort the list by the language name. (If a specific collation is not 
available
        // for the user's language, this falls back to a generic 'root' one.)
        $collator = Collator::create( $userLangCode );
-       $collator->sort( $uwLanguages );
+       $collator->asort( $uwLanguages );
        // Cache the list for 1 day
        $wgMemc->set( $cacheKey, $uwLanguages, 60 * 60 * 24 );
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/372417
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I25dd0b4d1481c6f6ef1acb63179c52218a0066b3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to