Special:Contributions: Drop 'newbies' feature
authorJames D. Forrester <jforrester@wikimedia.org>
Fri, 2 Aug 2019 19:06:31 +0000 (12:06 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Tue, 27 Aug 2019 19:18:14 +0000 (21:18 +0200)
This old, low-value feature has been replaced by the much more featureful
functionality on RecentChanges, which has the added advantage of using an
efficient query.

Bug: T220447
Change-Id: I2e6e12b2ad627ecc346883878811ec0164cd03da

RELEASE-NOTES-1.34
includes/specials/SpecialContributions.php
languages/i18n/en.json
languages/i18n/qqq.json

index 73a1f7b..0f8085b 100644 (file)
@@ -88,6 +88,8 @@ For notes on 1.33.x and older releases, see HISTORY.
   ([[Special:NewSection/Test]] redirects to creating a new section in "Test").
   Otherwise, it displays a basic interface to allow the end user to specify
   the target manually.
+* (T220447) Special:Contributions/newbies has been removed for performance and
+  usefulness reasons. Use Special:RecentChanges?userExpLevel=newcomer instead.
 
 === New developer features in 1.34 ===
 * The ImgAuthModifyHeaders hook was added to img_auth.php to allow modification
index 0425a58..f1843ea 100644 (file)
@@ -55,13 +55,6 @@ class SpecialContributions extends IncludableSpecialPage {
 
                $target = $par ?? $request->getVal( 'target' );
 
-               if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 'newbies' ) {
-                       $target = 'newbies';
-                       $this->opts['contribs'] = 'newbie';
-               } else {
-                       $this->opts['contribs'] = 'user';
-               }
-
                $this->opts['deletedOnly'] = $request->getBool( 'deletedOnly' );
 
                if ( !strlen( $target ) ) {
@@ -81,14 +74,7 @@ class SpecialContributions extends IncludableSpecialPage {
                $this->opts['hideMinor'] = $request->getBool( 'hideMinor' );
 
                $id = 0;
-               if ( $this->opts['contribs'] === 'newbie' ) {
-                       $userObj = User::newFromName( $target ); // hysterical raisins
-                       $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub' ) );
-                       $out->setHTMLTitle( $this->msg(
-                               'pagetitle',
-                               $this->msg( 'sp-contributions-newbies-title' )->plain()
-                       )->inContentLanguage() );
-               } elseif ( ExternalUserNames::isExternal( $target ) ) {
+               if ( ExternalUserNames::isExternal( $target ) ) {
                        $userObj = User::newFromName( $target, false );
                        if ( !$userObj ) {
                                $out->addHTML( $this->getForm() );
@@ -217,7 +203,8 @@ class SpecialContributions extends IncludableSpecialPage {
                        }
                        $pager = new ContribsPager( $this->getContext(), [
                                'target' => $target,
-                               'contribs' => $this->opts['contribs'],
+                               // Temporary, until newbie feature is fully removed from ContribsPager
+                               'contribs' => 'user',
                                'namespace' => $this->opts['namespace'],
                                'tagfilter' => $this->opts['tagfilter'],
                                'start' => $this->opts['start'],
@@ -256,9 +243,7 @@ class SpecialContributions extends IncludableSpecialPage {
                        $out->preventClickjacking( $pager->getPreventClickjacking() );
 
                        # Show the appropriate "footer" message - WHOIS tools, etc.
-                       if ( $this->opts['contribs'] == 'newbie' ) {
-                               $message = 'sp-contributions-footer-newbies';
-                       } elseif ( IP::isValidRange( $target ) ) {
+                       if ( IP::isValidRange( $target ) ) {
                                $message = 'sp-contributions-footer-anon-range';
                        } elseif ( IP::isIPAddress( $target ) ) {
                                $message = 'sp-contributions-footer-anon';
@@ -491,10 +476,6 @@ class SpecialContributions extends IncludableSpecialPage {
                        $this->opts['associated'] = false;
                }
 
-               if ( !isset( $this->opts['contribs'] ) ) {
-                       $this->opts['contribs'] = 'user';
-               }
-
                if ( !isset( $this->opts['start'] ) ) {
                        $this->opts['start'] = '';
                }
@@ -503,10 +484,6 @@ class SpecialContributions extends IncludableSpecialPage {
                        $this->opts['end'] = '';
                }
 
-               if ( $this->opts['contribs'] == 'newbie' ) {
-                       $this->opts['target'] = '';
-               }
-
                if ( !isset( $this->opts['tagfilter'] ) ) {
                        $this->opts['tagfilter'] = '';
                }
@@ -578,20 +555,12 @@ class SpecialContributions extends IncludableSpecialPage {
                        $filterSelection = Html::rawElement( 'div', [], '' );
                }
 
-               $labelNewbies = Xml::radioLabel(
-                       $this->msg( 'sp-contributions-newbies' )->text(),
-                       'contribs',
-                       'newbie',
-                       'newbie',
-                       $this->opts['contribs'] == 'newbie',
-                       [ 'class' => 'mw-input' ]
-               );
                $labelUsername = Xml::radioLabel(
                        $this->msg( 'sp-contributions-username' )->text(),
                        'contribs',
                        'user',
                        'user',
-                       $this->opts['contribs'] == 'user',
+                       true,
                        [ 'class' => 'mw-input' ]
                );
                $input = Html::input(
@@ -607,16 +576,15 @@ class SpecialContributions extends IncludableSpecialPage {
                                        'mw-autocomplete-user', // used by mediawiki.userSuggest
                                ],
                        ] + (
-                               // Only autofocus if target hasn't been specified or in non-newbies mode
-                               ( $this->opts['contribs'] === 'newbie' || $this->opts['target'] )
-                                       ? [] : [ 'autofocus' => true ]
-                               )
+                               // Only autofocus if target hasn't been specified
+                               $this->opts['target'] ? [] : [ 'autofocus' => true ]
+                       )
                );
 
                $targetSelection = Html::rawElement(
                        'div',
                        [],
-                       $labelNewbies . '<br>' . $labelUsername . ' ' . $input . ' '
+                       $labelUsername . ' ' . $input . ' '
                );
 
                $hidden = $this->opts['namespace'] === '' ? ' mw-input-hidden' : '';
index 8988419..8f73054 100644 (file)
        "month": "From month (and earlier):",
        "year": "From year (and earlier):",
        "date": "From date (and earlier):",
-       "sp-contributions-newbies": "Show contributions of new accounts only",
-       "sp-contributions-newbies-sub": "For new accounts",
-       "sp-contributions-newbies-title": "User contributions for new accounts",
        "sp-contributions-blocklog": "block log",
        "sp-contributions-suppresslog": "suppressed {{GENDER:$1|user}} contributions",
        "sp-contributions-deleted": "deleted {{GENDER:$1|user}} contributions",
        "sp-contributions-footer": "-",
        "sp-contributions-footer-anon": "-",
        "sp-contributions-footer-anon-range": "-",
-       "sp-contributions-footer-newbies": "-",
        "sp-contributions-outofrange": "Unable to show any results. The requested IP range is larger than the CIDR limit of /$1.",
        "whatlinkshere": "What links here",
        "whatlinkshere-title": "Pages that link to \"$1\"",
index 07a317e..12f2948 100644 (file)
        "versionrequired": "This message is not used in the MediaWiki core, but was introduced with the reason that it could be useful for extensions.\n\nParameters:\n* $1 - MediaWiki version number\nSee also:\n* {{msg-mw|Versionrequiredtext}}",
        "versionrequiredtext": "This message is not used in the MediaWiki core, but was introduced with the reason that it could be useful for extensions.\n\nParameters:\n* $1 - MediaWiki version number\nSee also:\n* {{msg-mw|Versionrequired}}",
        "ok": "{{Identical|OK}}",
-       "pagetitle": "{{Optional}}\n{{doc-important|You most probably do not need to translate this message.}}\nDo '''not''' replace SITENAME with a translation of Wikipedia or some encyclopedic additions. The message has to be neutral for all projects.\n\nParameters:\n* $1 - page title or any one of the following messages:\n** {{msg-mw|Contributions-title}}\n** {{msg-mw|Searchresults-title}}\n** {{msg-mw|Sp-contributions-newbies-title}}",
+       "pagetitle": "{{Optional}}\n{{doc-important|You most probably do not need to translate this message.}}\nDo '''not''' replace SITENAME with a translation of Wikipedia or some encyclopedic additions. The message has to be neutral for all projects.\n\nParameters:\n* $1 - page title or any one of the following messages:\n** {{msg-mw|Contributions-title}}\n** {{msg-mw|Searchresults-title}}",
        "pagetitle-view-mainpage": "{{optional}}",
        "backlinksubtitle": "{{optional}}\nAppears in subtitle. Parameters:\n* $1 - a link to the page (HTML)",
        "retrievedfrom": "Message which appears in the source of every page, but it is hidden. It is shown when printing.\n\nParameters:\n* $1 - a link back to the current page: {{FULLURL:{{FULLPAGENAME}}}}",
        "month": "Used in [[Special:Contributions]] and history pages ([{{fullurl:Sandbox|action=history}} example]), as label for a dropdown box to select a specific month to view the edits made in that month, and the earlier months. See also {{msg-mw|year}}.",
        "year": "Used in [[Special:Contributions]] and history pages ([{{fullurl:Sandbox|action=history}} example]), as label for an input box to select a specific year to view the edits made in that year, and the earlier years.\n\nSee also:\n* {{msg-mw|month}}",
        "date": "Used in [[Special:Contributions]] and history pages ([{{fullurl:Sandbox|action=history}} example]), as label for an input box to select a specific date to view the edits made on that date, and earlier.",
-       "sp-contributions-newbies": "Text of radio button on special page [[Special:Contributions]].",
-       "sp-contributions-newbies-sub": "Note at the top of the page of results for a search on [[Special:Contributions]] where 'Show contributions for new accounts only' has been selected.",
-       "sp-contributions-newbies-title": "The page title in your browser bar, but not the page title.\n\nSee also:\n* {{msg-mw|Sp-contributions-newbies-sub}}",
        "sp-contributions-blocklog": "Used as a display name for a link to the block log on for example [[Special:Contributions/Mediawiki default]]\n\nUsed as link title in [[Special:Contributions]] and in [[Special:DeletedContributions]].\n\nSee also:\n* {{msg-mw|Sp-contributions-talk}}\n* {{msg-mw|Change-blocklink}}\n* {{msg-mw|Unblocklink}}\n* {{msg-mw|Blocklink}}\n* {{msg-mw|Sp-contributions-uploads}}\n* {{msg-mw|Sp-contributions-logs}}\n* {{msg-mw|Sp-contributions-deleted}}\n* {{msg-mw|Sp-contributions-userrights}}\n{{Identical|Block log}}",
        "sp-contributions-suppresslog": "Used as a display name for a link to log entries of suppressed edits made by that user.\n\nUsed as link title in [[Special:Contributions]] and in [[Special:DeletedContributions]]. Parameters:\n* $1 is a plain text username used for GENDER.\nSee also {{msg-mw|sp-contributions-deleted}}, {{msg-mw|sp-deletedcontributions-contribs}}, {{msg-mw|contributions}}, {{msg-mw|deletedcontributions-title}}.",
        "sp-contributions-deleted": "This is a link anchor used in [[Special:Contributions]]/''name'', when user viewing the page has the right to delete pages, or to restore deleted pages.\n\nUsed as link title in [[Special:Contributions]]. Parameters:\n* $1 is a plain text username used for GENDER.\nSee also:\n* {{msg-mw|Sp-contributions-talk}}\n* {{msg-mw|Change-blocklink}}\n* {{msg-mw|Unblocklink}}\n* {{msg-mw|Blocklink}}\n* {{msg-mw|Sp-contributions-blocklog}}\n* {{msg-mw|Sp-contributions-uploads}}\n* {{msg-mw|Sp-contributions-logs}}\n* {{msg-mw|Sp-contributions-userrights}}",
        "sp-contributions-footer": "{{ignored}}This is the footer for users that are not anonymous or newbie on [[Special:Contributions]].",
        "sp-contributions-footer-anon": "{{ignored}}This is the footer for anonymous users on [[Special:Contributions]].",
        "sp-contributions-footer-anon-range": "{{ignored}}This is the footer for IP ranges on [[Special:Contributions]].",
-       "sp-contributions-footer-newbies": "{{ignored}}This is the footer for newbie users on [[Special:Contributions]].",
        "sp-contributions-outofrange": "Message shown when a user tries to view contributions of an IP range that's too large. $1 is the numerical limit imposed on the CIDR range.",
        "whatlinkshere": "The text of the link in the toolbox (on the left, below the search menu) going to [[Special:WhatLinksHere]].\n\nSee also:\n* {{msg-mw|Whatlinkshere}}\n* {{msg-mw|Accesskey-t-whatlinkshere}}\n* {{msg-mw|Tooltip-t-whatlinkshere}}",
        "whatlinkshere-title": "Title of the special page [[Special:WhatLinksHere]]. This page appears when you click on the 'What links here' button in the toolbox. $1 is the name of the page concerned.",