Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89423


Change subject: Simplify watchlist edit mode handling
......................................................................

Simplify watchlist edit mode handling

The old "clear" mode has been killed years ago and now acts the same
as the "raw" mode.

Make SpecialEditWatchlist::getMode() return EDIT_RAW where it would
previously return EDIT_CLEAR, simplify handling at call sites, update
comments.

Change-Id: I1213c83b7040ae500a0299817ee503ab1b5616c6
---
M includes/specials/SpecialEditWatchlist.php
M includes/specials/SpecialWatchlist.php
2 files changed, 7 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/89423/1

diff --git a/includes/specials/SpecialEditWatchlist.php 
b/includes/specials/SpecialEditWatchlist.php
index b6005de..b33703d 100644
--- a/includes/specials/SpecialEditWatchlist.php
+++ b/includes/specials/SpecialEditWatchlist.php
@@ -36,7 +36,8 @@
  */
 class SpecialEditWatchlist extends UnlistedSpecialPage {
        /**
-        * Editing modes
+        * Editing modes. EDIT_CLEAR is no longer used; the "Clear" link scared 
people
+        * too much. Now it's passed on to the raw editor, from which it's very 
easy to clear.
         */
        const EDIT_CLEAR = 1;
        const EDIT_RAW = 2;
@@ -95,10 +96,6 @@
                $mode = self::getMode( $this->getRequest(), $mode );
 
                switch ( $mode ) {
-                       case self::EDIT_CLEAR:
-                               // The "Clear" link scared people too much.
-                               // Pass on to the raw editor, from which it's 
very easy to clear.
-
                        case self::EDIT_RAW:
                                $out->setPageTitle( $this->msg( 
'watchlistedit-raw-title' ) );
                                $form = $this->getRawForm();
@@ -636,7 +633,6 @@
                switch ( $mode ) {
                        case 'clear':
                        case self::EDIT_CLEAR:
-                               return self::EDIT_CLEAR;
                        case 'raw':
                        case self::EDIT_RAW:
                                return self::EDIT_RAW;
diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 59f0dfe..6572a08 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -74,18 +74,12 @@
 
                $mode = SpecialEditWatchlist::getMode( $request, $par );
                if ( $mode !== false ) {
-                       # TODO: localise?
-                       switch ( $mode ) {
-                               case SpecialEditWatchlist::EDIT_CLEAR:
-                                       $mode = 'clear';
-                                       break;
-                               case SpecialEditWatchlist::EDIT_RAW:
-                                       $mode = 'raw';
-                                       break;
-                               default:
-                                       $mode = null;
+                       if ( $mode === SpecialEditWatchlist::EDIT_RAW ) {
+                               $title = SpecialPage::getTitleFor( 
'EditWatchlist', 'raw' );
+                       } else {
+                               $title = SpecialPage::getTitleFor( 
'EditWatchlist' );
                        }
-                       $title = SpecialPage::getTitleFor( 'EditWatchlist', 
$mode );
+
                        $output->redirect( $title->getLocalURL() );
                        return;
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1213c83b7040ae500a0299817ee503ab1b5616c6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

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

Reply via email to