(bug 6493) Preserve language selections in the mode switch link on Special:Userlogin
authorRob Church <robchurch@users.mediawiki.org>
Fri, 30 Jun 2006 09:13:53 +0000 (09:13 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Fri, 30 Jun 2006 09:13:53 +0000 (09:13 +0000)
includes/CategoryPage.php
includes/SpecialUserlogin.php

index 53d6997..93f5d71 100644 (file)
@@ -83,7 +83,7 @@ class CategoryPage extends Article {
                $limit = $wgCategoryPagingLimit;
                $res = $dbr->select(
                        array( 'page', 'categorylinks' ),
-                       array( 'page_title', 'page_namespace', 'page_len', 'cl_sortkey' ),
+                       array( 'page_title', 'page_namespace', 'page_is_redirect', 'page_len', 'cl_sortkey' ),
                        array( $pageCondition,
                               'cl_from          =  page_id',
                               'cl_to'           => $this->mTitle->getDBKey()),
index 6a605fd..4ee35b1 100644 (file)
@@ -474,10 +474,8 @@ class LoginForm {
         * @private
         */
        function mainLoginForm( $msg, $msgtype = 'error' ) {
-               global $wgUser, $wgOut;
-               global $wgAllowRealName, $wgEnableEmail;
-               global $wgCookiePrefix;
-               global $wgAuth;
+               global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail;
+               global $wgCookiePrefix, $wgAuth, $wgLoginLanguageSelector;
 
                if ( $this->mType == 'signup' && !$wgUser->isAllowedToCreateAccount() ) {
                        $this->userNotPrivilegedMessage();
@@ -514,6 +512,10 @@ class LoginForm {
                        $q .= $returnto;
                        $linkq .= $returnto;
                }
+               
+               # Pass any language selection on to the mode switch link
+               if( $wgLoginLanguageSelector && $this->mLanguage )
+                       $linkq .= '&uselang=' . $this->mLanguage;
 
                $link = '<a href="' . htmlspecialchars ( $titleObj->getLocalUrl( $linkq ) ) . '">';
                $link .= wfMsgHtml( $linkmsg . 'link' );
@@ -541,7 +543,7 @@ class LoginForm {
                $template->set( 'useemail', $wgEnableEmail );
                $template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember  );
                                
-               global $wgLoginLanguageSelector;
+               # Prepare language selection links as needed
                if( $wgLoginLanguageSelector ) {
                        $template->set( 'languages', $this->makeLanguageSelector() );
                        if( $this->mLanguage )