From de3a806942a6da3241cb5056b5e06dc906f756af Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 30 Jun 2006 09:13:53 +0000 Subject: [PATCH] (bug 6493) Preserve language selections in the mode switch link on Special:Userlogin --- includes/CategoryPage.php | 2 +- includes/SpecialUserlogin.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 53d69971b9..93f5d71f3b 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -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()), diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 6a605fdc65..4ee35b1bfb 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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 = ''; $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 ) -- 2.20.1