jenkins-bot has submitted this change and it was merged.

Change subject: Bug 51078: Correct anonymous watchlist url
......................................................................


Bug 51078: Correct anonymous watchlist url

Tested against Iaa00ab48ac4d802b68c1c87ea14104cac01324dd

Change-Id: I8e5339571724bf7a008bdc58558454528dfeb664
---
M includes/skins/SkinMobile.php
M includes/skins/UserLoginAndCreateTemplate.php
2 files changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 69b1222..a6cb9a0 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -233,6 +233,7 @@
        protected function preparePersonalTools( QuickTemplate $tpl ) {
                $returnToTitle = $this->getTitle()->getPrefixedText();
                $donateTitle = SpecialPage::getTitleFor( 'Uploads' );
+               $watchTitle = SpecialPage::getTitleFor( 'Watchlist' );
 
                // watchlist link
                $watchlistQuery = array();
@@ -251,7 +252,9 @@
                $items = array(
                        'watchlist' => array(
                                'text' => wfMessage( 
'mobile-frontend-main-menu-watchlist' )->escaped(),
-                               'href' => SpecialPage::getTitleFor( 'Watchlist' 
)->getLocalUrl( $watchlistQuery ),
+                               'href' => $this->getUser()->isLoggedIn() ?
+                                       $watchTitle->getLocalUrl( 
$watchlistQuery ) :
+                                       static::getLoginUrl( array( 'returnto' 
=> $watchTitle ) ),
                                'class' => 'icon-watchlist jsonly',
                        ),
                        'uploads' => array(
diff --git a/includes/skins/UserLoginAndCreateTemplate.php 
b/includes/skins/UserLoginAndCreateTemplate.php
index b520958..1ce2bc8 100644
--- a/includes/skins/UserLoginAndCreateTemplate.php
+++ b/includes/skins/UserLoginAndCreateTemplate.php
@@ -80,7 +80,7 @@
                $returntoQuery = $req->getVal( 'returntoquery' );
                if ( $returnto == 'Uploads' ) {
                        $key = 'mobile-frontend-donate-image-login';
-               } elseif ( strstr( $returntoQuery, 'article_action=watch' ) ) {
+               } elseif ( $returnto == 'Watchlist' || strstr( $returntoQuery, 
'article_action=watch' ) ) {
                        $key = 'mobile-frontend-watch-login';
                } elseif ( strstr( $returntoQuery, 
'article_action=photo-upload' ) ) {
                        $key = 'mobile-frontend-photo-upload-login';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e5339571724bf7a008bdc58558454528dfeb664
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to