(follow-up r65035/r65013) The username parameter wasn't preserved when clicking links...
authorBrian Wolff <bawolff@users.mediawiki.org>
Wed, 16 Mar 2011 18:23:04 +0000 (18:23 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Wed, 16 Mar 2011 18:23:04 +0000 (18:23 +0000)
RELEASE-NOTES
includes/specials/SpecialListfiles.php

index 576edb0..649c444 100644 (file)
@@ -193,6 +193,7 @@ PHP if you have not done so prior to upgrading MediaWiki.
   for "ABORTED" reason to be returned and displayed to user.
 * (bug 28034) uploading file to local wiki when file exists on shared repository
   (commons) gives spurious info in the warning message
+* Usernames get lost when selecting different sorts on Special:listfiles
 
 === API changes in 1.18 ===
 * (bug 26339) Throw warning when truncating an overlarge API result
index 49eb60a..a6bc714 100644 (file)
@@ -238,9 +238,19 @@ class ImageListPager extends TablePager {
                if ( !is_null( $this->mUserName ) ) {
                        # Append the username to the query string
                        foreach ( $queries as &$query ) {
-                               $query['username'] = $this->mUserName;
+                               $query['user'] = $this->mUserName;
                        }
                }
                return $queries;
        }
+
+       function getDefaultQuery() {
+               $queries = parent::getDefaultQuery();
+               if ( !isset( $queries['user'] )
+                       && !is_null( $this->mUserName ) )
+               {
+                       $queries['user'] = $this->mUserName;
+               }
+               return $queries;
+       }
 }