Removing all disambiguation code from core
authorkaldari <kaldari@gmail.com>
Wed, 17 Jul 2013 00:14:31 +0000 (17:14 -0700)
committerkaldari <rkaldari@wikimedia.org>
Thu, 5 Sep 2013 21:07:51 +0000 (14:07 -0700)
Disambiguation related functions have been re-implemented in the
Disambiguator extension.

Bug: 35981
Change-Id: I4afa30bf2677c6541ef355013f8eaef46abfbe03
Dependency: I41637ea43a9e5000bcb8a782441ce36f1068881f

RELEASE-NOTES-1.22
includes/AutoLoader.php
includes/QueryPage.php
includes/SpecialPageFactory.php
includes/specials/SpecialDisambiguations.php [deleted file]
languages/messages/MessagesEn.php
maintenance/dictionary/mediawiki.dic
maintenance/language/messages.inc
tests/parser/preprocess/All_system_messages.expected
tests/parser/preprocess/All_system_messages.txt

index 44b0fae..8cdb985 100644 (file)
@@ -437,6 +437,10 @@ changes to languages because of Bugzilla reports.
   using properties in the SpecialPrefixindex class.
 * (bug 50310) BREAKING CHANGE: wikibits: Drop support for mwCustomEditButtons.
   It defaults to an empty array and emits mw.log.warn when accessed.
+* BREAKING CHANGE: Special:Disambiguations has been removed from MediaWiki core.
+  Functions related to disambiguation pages are now handled by the Disambiguator
+  extension (https://www.mediawiki.org/wiki/Extension:Disambiguator) (bug
+  35981).
 
 == Compatibility ==
 
index 677bed3..604add3 100644 (file)
@@ -920,7 +920,6 @@ $wgAutoloadLocalClasses = array(
        'DeadendPagesPage' => 'includes/specials/SpecialDeadendpages.php',
        'DeletedContribsPager' => 'includes/specials/SpecialDeletedContributions.php',
        'DeletedContributionsPage' => 'includes/specials/SpecialDeletedContributions.php',
-       'DisambiguationsPage' => 'includes/specials/SpecialDisambiguations.php',
        'DoubleRedirectsPage' => 'includes/specials/SpecialDoubleRedirects.php',
        'EditWatchlistCheckboxSeriesField' => 'includes/specials/SpecialEditWatchlist.php',
        'EditWatchlistNormalHTMLForm' => 'includes/specials/SpecialEditWatchlist.php',
index 699c843..51b5706 100644 (file)
@@ -35,7 +35,6 @@ $wgQueryPages = array(
        array( 'AncientPagesPage',              'Ancientpages'                  ),
        array( 'BrokenRedirectsPage',           'BrokenRedirects'               ),
        array( 'DeadendPagesPage',              'Deadendpages'                  ),
-       array( 'DisambiguationsPage',           'Disambiguations'               ),
        array( 'DoubleRedirectsPage',           'DoubleRedirects'               ),
        array( 'FileDuplicateSearchPage',       'FileDuplicateSearch'           ),
        array( 'LinkSearchPage',                'LinkSearch'                    ),
index a412fdb..c03f1ba 100644 (file)
@@ -78,7 +78,6 @@ class SpecialPageFactory {
                'Allpages'                  => 'SpecialAllpages',
                'Prefixindex'               => 'SpecialPrefixindex',
                'Categories'                => 'SpecialCategories',
-               'Disambiguations'           => 'DisambiguationsPage',
                'Listredirects'             => 'ListredirectsPage',
                'PagesWithProp'             => 'SpecialPagesWithProp',
 
diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php
deleted file mode 100644 (file)
index ceecd15..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/**
- * Implements Special:Disambiguations
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup SpecialPage
- */
-
-/**
- * A special page that lists pages containing links to disambiguations pages
- *
- * @ingroup SpecialPage
- */
-class DisambiguationsPage extends QueryPage {
-       function __construct( $name = 'Disambiguations' ) {
-               parent::__construct( $name );
-       }
-
-       function isExpensive() {
-               return true;
-       }
-
-       function isSyndicated() {
-               return false;
-       }
-
-       function getPageHeader() {
-               return $this->msg( 'disambiguations-text' )->parseAsBlock();
-       }
-
-       /**
-        * @return string|bool False on failure
-        */
-       function getQueryFromLinkBatch() {
-               $dbr = wfGetDB( DB_SLAVE );
-               $dMsgText = $this->msg( 'disambiguationspage' )->inContentLanguage()->text();
-               $linkBatch = new LinkBatch;
-
-               # If the text can be treated as a title, use it verbatim.
-               # Otherwise, pull the titles from the links table
-               $dp = Title::newFromText( $dMsgText );
-               if ( $dp ) {
-                       if ( $dp->getNamespace() != NS_TEMPLATE ) {
-                               # @todo FIXME: We assume the disambiguation message is a template but
-                               # the page can potentially be from another namespace :/
-                               wfDebug( "Mediawiki:disambiguationspage message does not refer to a template!\n" );
-                       }
-                       $linkBatch->addObj( $dp );
-               } else {
-                       # Get all the templates linked from the Mediawiki:Disambiguationspage
-                       $disPageObj = Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage' );
-                       $res = $dbr->select(
-                               array( 'pagelinks', 'page' ),
-                               'pl_title',
-                               array(
-                                       'page_id = pl_from',
-                                       'pl_namespace' => NS_TEMPLATE,
-                                       'page_namespace' => $disPageObj->getNamespace(),
-                                       'page_title' => $disPageObj->getDBkey()
-                               ),
-                               __METHOD__
-                       );
-
-                       foreach ( $res as $row ) {
-                               $linkBatch->addObj( Title::makeTitle( NS_TEMPLATE, $row->pl_title ) );
-                       }
-               }
-               $set = $linkBatch->constructSet( 'tl', $dbr );
-
-               if ( $set === false ) {
-                       # We must always return a valid SQL query, but this way
-                       # the DB will always quickly return an empty result
-                       $set = 'FALSE';
-                       wfDebug( "Mediawiki:disambiguationspage message does not link to any templates!\n" );
-               }
-
-               return $set;
-       }
-
-       function getQueryInfo() {
-               // @todo FIXME: What are pagelinks and p2 doing here?
-               return array(
-                       'tables' => array(
-                               'templatelinks',
-                               'p1' => 'page',
-                               'pagelinks',
-                               'p2' => 'page'
-                       ),
-                       'fields' => array(
-                               'namespace' => 'p1.page_namespace',
-                               'title' => 'p1.page_title',
-                               'value' => 'pl_from'
-                       ),
-                       'conds' => array(
-                               $this->getQueryFromLinkBatch(),
-                               'p1.page_id = tl_from',
-                               'pl_namespace = p1.page_namespace',
-                               'pl_title = p1.page_title',
-                               'p2.page_id = pl_from',
-                               'p2.page_namespace' => MWNamespace::getContentNamespaces()
-                       )
-               );
-       }
-
-       function getOrderFields() {
-               return array( 'tl_namespace', 'tl_title', 'value' );
-       }
-
-       function sortDescending() {
-               return false;
-       }
-
-       /**
-        * Fetch links and cache their existence
-        *
-        * @param DatabaseBase $db
-        * @param ResultWrapper $res
-        */
-       function preprocessResults( $db, $res ) {
-               if ( !$res->numRows() ) {
-                       return;
-               }
-
-               $batch = new LinkBatch;
-               foreach ( $res as $row ) {
-                       $batch->add( $row->namespace, $row->title );
-               }
-               $batch->execute();
-
-               $res->seek( 0 );
-       }
-
-       /**
-        * @param Skin $skin
-        * @param object $result Result row
-        * @return string
-        */
-       function formatResult( $skin, $result ) {
-               $title = Title::newFromID( $result->value );
-               $dp = Title::makeTitle( $result->namespace, $result->title );
-
-               $from = Linker::link( $title );
-               $edit = Linker::link(
-                       $title,
-                       $this->msg( 'parentheses', $this->msg( 'editlink' )->text() )->escaped(),
-                       array(),
-                       array( 'redirect' => 'no', 'action' => 'edit' )
-               );
-               $arr = $this->getLanguage()->getArrow();
-               $to = Linker::link( $dp );
-
-               return "$from $edit $arr $to";
-       }
-
-       protected function getGroupName() {
-               return 'pages';
-       }
-}
index dc08e0f..b047783 100644 (file)
@@ -403,7 +403,6 @@ $specialPageAliases = array(
        'CreateAccount'             => array( 'CreateAccount' ),
        'Deadendpages'              => array( 'DeadendPages' ),
        'DeletedContributions'      => array( 'DeletedContributions' ),
-       'Disambiguations'           => array( 'Disambiguations' ),
        'DoubleRedirects'           => array( 'DoubleRedirects' ),
        'EditWatchlist'             => array( 'EditWatchlist' ),
        'Emailuser'                 => array( 'EmailUser' ),
@@ -904,7 +903,7 @@ $1',
 'pool-queuefull'     => 'Pool queue is full',
 'pool-errorunknown'  => 'Unknown error',
 
-# All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).
+# All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage).
 'aboutsite'            => 'About {{SITENAME}}',
 'aboutpage'            => 'Project:About',
 'copyright'            => 'Content is available under $1.',
@@ -2662,13 +2661,6 @@ Remember to check for other links to the templates before deleting them.',
 'statistics-mostpopular'       => 'Most viewed pages',
 'statistics-footer'            => '', # do not translate or duplicate this message to other languages
 
-'disambiguations'         => 'Pages linking to disambiguation pages',
-'disambiguations-summary' => '', # do not translate or duplicate this message to other languages
-'disambiguationspage'     => 'Template:disambig',
-'disambiguations-text'    => "The following pages contain at least one link to a '''disambiguation page'''.
-They may have to link to a more appropriate page instead.<br />
-A page is treated as a disambiguation page if it uses a template that is linked from [[MediaWiki:Disambiguationspage]].",
-
 'pageswithprop'                   => 'Pages with a page property',
 'pageswithprop-summary'           => '', # do not translate or duplicate this message to other languages
 'pageswithprop-legend'            => 'Pages with a page property',
index b86d2c5..0c1ace1 100644 (file)
@@ -74,7 +74,6 @@ Delete
 Deletedrevs
 Denied
 Dfile
-Disambiguations
 Double
 Duplicate
 EAGAIN
index f23f08c..b2db694 100644 (file)
@@ -1726,12 +1726,6 @@ $wgMessageStructure = array(
                'statistics-mostpopular',
                'statistics-footer',
        ),
-       'disambiguations' => array(
-               'disambiguations',
-               'disambiguations-summary',
-               'disambiguationspage',
-               'disambiguations-text',
-       ),
        'pageswithprop' => array(
                'pageswithprop',
                'pageswithprop-summary',
@@ -4004,7 +3998,7 @@ future releases. Also note that since each list value is wrapped in a unique
        'cologneblue'         => 'Cologne Blue skin',
        'vector'              => 'Vector skin',
        'miscellaneous2'      => '',
-       'links'               => 'All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).',
+       'links'               => 'All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage).',
        'badaccess'           => '',
        'versionrequired'     => '',
        'miscellaneous3'      => '',
@@ -4068,7 +4062,6 @@ future releases. Also note that since each list value is wrapped in a unique
        'randomincategory'    => 'Random page in category',
        'randomredirect'      => 'Random redirect',
        'statistics'          => 'Statistics',
-       'disambiguations'     => '',
        'pageswithprop'       => '',
        'doubleredirects'     => '',
        'brokenredirects'     => '',
index 897c5fb..078d8f0 100644 (file)
@@ -1239,27 +1239,6 @@ diff
 &lt;/td&gt;&lt;td&gt;
 <template lineStart="1"><title>int:Difference</title></template>
 &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguations&amp;action=edit disambiguations]&lt;br&gt;
-[[MediaWiki_talk:Disambiguations|Talk]]
-&lt;/td&gt;&lt;td&gt;
-Disambiguation pages
-&lt;/td&gt;&lt;td&gt;
-<template lineStart="1"><title>int:Disambiguations</title></template>
-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguationspage&amp;action=edit disambiguationspage]&lt;br&gt;
-[[MediaWiki_talk:Disambiguationspage|Talk]]
-&lt;/td&gt;&lt;td&gt;
-Wiktionary:Links_to_disambiguating_pages
-&lt;/td&gt;&lt;td&gt;
-<template lineStart="1"><title>int:Disambiguationspage</title></template>
-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguationstext&amp;action=edit disambiguationstext]&lt;br&gt;
-[[MediaWiki_talk:Disambiguationstext|Talk]]
-&lt;/td&gt;&lt;td&gt;
-The following pages link to a &amp;lt;i&amp;gt;disambiguation page&amp;lt;/i&amp;gt;. They should link to the appropriate topic instead.&amp;lt;br /&amp;gt;A page is treated as dismbiguation if it is linked from $1.&amp;lt;br /&amp;gt;Links from other namespaces are &amp;lt;i&amp;gt;not&amp;lt;/i&amp;gt; listed here.
-&lt;/td&gt;&lt;td&gt;
-<template lineStart="1"><title>int:Disambiguationstext</title></template>
-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;
 [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&amp;action=edit disclaimerpage]&lt;br&gt;
 [[MediaWiki_talk:Disclaimerpage|Talk]]
 &lt;/td&gt;&lt;td&gt;
index fc10d7c..3c30da9 100644 (file)
@@ -1239,27 +1239,6 @@ diff
 </td><td>
 {{int:Difference}}
 </td></tr><tr><td>
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguations&action=edit disambiguations]<br>
-[[MediaWiki_talk:Disambiguations|Talk]]
-</td><td>
-Disambiguation pages
-</td><td>
-{{int:Disambiguations}}
-</td></tr><tr><td>
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguationspage&action=edit disambiguationspage]<br>
-[[MediaWiki_talk:Disambiguationspage|Talk]]
-</td><td>
-Wiktionary:Links_to_disambiguating_pages
-</td><td>
-{{int:Disambiguationspage}}
-</td></tr><tr><td>
-[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disambiguationstext&action=edit disambiguationstext]<br>
-[[MediaWiki_talk:Disambiguationstext|Talk]]
-</td><td>
-The following pages link to a &lt;i&gt;disambiguation page&lt;/i&gt;. They should link to the appropriate topic instead.&lt;br /&gt;A page is treated as dismbiguation if it is linked from $1.&lt;br /&gt;Links from other namespaces are &lt;i&gt;not&lt;/i&gt; listed here.
-</td><td>
-{{int:Disambiguationstext}}
-</td></tr><tr><td>
 [http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit disclaimerpage]<br>
 [[MediaWiki_talk:Disclaimerpage|Talk]]
 </td><td>