Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73115
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/15/73115/1
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: newchange
Gerrit-Change-Id: I8e5339571724bf7a008bdc58558454528dfeb664
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits