Konarak has uploaded a new change for review. https://gerrit.wikimedia.org/r/123837
Change subject: MediaWiki:Watchnologintext: Add returnto parameter ...................................................................... MediaWiki:Watchnologintext: Add returnto parameter Bug: 60594 Change-Id: Ic8c0ea5b203c63f9273992cb70bfb06c0d461311 --- M includes/actions/WatchAction.php M languages/i18n/en.json 2 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/37/123837/1 diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php index e1b5d52..c2f8292 100644 --- a/includes/actions/WatchAction.php +++ b/includes/actions/WatchAction.php @@ -82,7 +82,14 @@ protected function checkCanExecute( User $user ) { // Must be logged in if ( $user->isAnon() ) { - throw new ErrorPageError( 'watchnologin', 'watchnologintext' ); + $loginreqlink = Linker::linkKnown( + SpecialPage::getTitleFor( 'Userlogin' ), + $this->msg( 'loginreqlink' )->escaped(), + array(), + array( 'returnto' => $this->getPageTitle() ) + ); + $reasonMsg = $this->msg( 'watchnologintext' )->rawParams( $loginreqlink ); + throw new UserNotLoggedIn( $reasonMsg, 'watchnologin' ); } return parent::checkCanExecute( $user ); diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9031b96..16c8271 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1825,7 +1825,7 @@ "nowatchlist": "You have no items on your watchlist.", "watchlistanontext": "Please $1 to view or edit items on your watchlist.", "watchnologin": "Not logged in", - "watchnologintext": "You must be [[Special:UserLogin|logged in]] to modify your watchlist.", + "watchnologintext": "You must $1 to modify your watchlist.", "addwatch": "Add to watchlist", "addedwatchtext": "The page \"[[:$1]]\" has been added to your [[Special:Watchlist|watchlist]].\nFuture changes to this page and its associated talk page will be listed there.", "removewatch": "Remove from watchlist", -- To view, visit https://gerrit.wikimedia.org/r/123837 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8c0ea5b203c63f9273992cb70bfb06c0d461311 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Konarak <konarak...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits