Kaldari has uploaded a new change for review.
https://gerrit.wikimedia.org/r/74096
Change subject: Removing all disambiguation code from core
......................................................................
Removing all disambiguation code from core
Disambiguation related functions have been re-implemented in the
Disambiguator extension.
ProofreadPage extension needs to be updated before this is merged.
Bug: 35981
Change-Id: I4afa30bf2677c6541ef355013f8eaef46abfbe03
---
M includes/AutoLoader.php
M includes/QueryPage.php
M includes/SpecialPageFactory.php
D includes/specials/SpecialDisambiguations.php
M languages/messages/MessagesEn.php
M maintenance/dictionary/mediawiki.dic
M tests/parser/preprocess/All_system_messages.expected
M tests/parser/preprocess/All_system_messages.txt
8 files changed, 2 insertions(+), 229 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/96/74096/1
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index 2f0ac23..a64e992 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -899,7 +899,6 @@
'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',
diff --git a/includes/QueryPage.php b/includes/QueryPage.php
index 0abeb31..4646729 100644
--- a/includes/QueryPage.php
+++ b/includes/QueryPage.php
@@ -35,7 +35,6 @@
array( 'AncientPagesPage', 'Ancientpages'
),
array( 'BrokenRedirectsPage', 'BrokenRedirects'
),
array( 'DeadendPagesPage', 'Deadendpages'
),
- array( 'DisambiguationsPage', 'Disambiguations'
),
array( 'DoubleRedirectsPage', 'DoubleRedirects'
),
array( 'FileDuplicateSearchPage', 'FileDuplicateSearch'
),
array( 'LinkSearchPage', 'LinkSearch'
),
diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php
index 4d63553..198af09 100644
--- a/includes/SpecialPageFactory.php
+++ b/includes/SpecialPageFactory.php
@@ -78,7 +78,6 @@
'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
index ceecd15..0000000
--- a/includes/specials/SpecialDisambiguations.php
+++ /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';
- }
-}
diff --git a/languages/messages/MessagesEn.php
b/languages/messages/MessagesEn.php
index e3af968..68794df 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -398,7 +398,6 @@
'CreateAccount' => array( 'CreateAccount' ),
'Deadendpages' => array( 'DeadendPages' ),
'DeletedContributions' => array( 'DeletedContributions' ),
- 'Disambiguations' => array( 'Disambiguations' ),
'DoubleRedirects' => array( 'DoubleRedirects' ),
'EditWatchlist' => array( 'EditWatchlist' ),
'Emailuser' => array( 'EmailUser' ),
@@ -897,7 +896,7 @@
'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.',
@@ -2628,13 +2627,6 @@
'statistics-users-active-desc' => 'Users who have performed an action in the
last {{PLURAL:$1|day|$1 days}}',
'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
diff --git a/maintenance/dictionary/mediawiki.dic
b/maintenance/dictionary/mediawiki.dic
index b86d2c5..0c1ace1 100644
--- a/maintenance/dictionary/mediawiki.dic
+++ b/maintenance/dictionary/mediawiki.dic
@@ -74,7 +74,6 @@
Deletedrevs
Denied
Dfile
-Disambiguations
Double
Duplicate
EAGAIN
diff --git a/tests/parser/preprocess/All_system_messages.expected
b/tests/parser/preprocess/All_system_messages.expected
index 897c5fb..013677b 100644
--- a/tests/parser/preprocess/All_system_messages.expected
+++ b/tests/parser/preprocess/All_system_messages.expected
@@ -1239,27 +1239,6 @@
</td><td>
<template lineStart="1"><title>int:Difference</title></template>
</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>
-<template lineStart="1"><title>int:Disambiguations</title></template>
-</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>
-<template lineStart="1"><title>int:Disambiguationspage</title></template>
-</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>
-<template lineStart="1"><title>int:Disambiguationstext</title></template>
-</td></tr><tr><td>
[http://tl.wiktionary.org/w/wiki.phtml?title=MediaWiki:Disclaimerpage&action=edit
disclaimerpage]<br>
[[MediaWiki_talk:Disclaimerpage|Talk]]
</td><td>
@@ -5643,4 +5622,4 @@
<template lineStart="1"><title>int:Yourtext</title></template>
</td></tr></table>
-</root>
\ No newline at end of file
+</root>
diff --git a/tests/parser/preprocess/All_system_messages.txt
b/tests/parser/preprocess/All_system_messages.txt
index fc10d7c..3c30da9 100644
--- a/tests/parser/preprocess/All_system_messages.txt
+++ b/tests/parser/preprocess/All_system_messages.txt
@@ -1239,27 +1239,6 @@
</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 <i>disambiguation page</i>. They
should link to the appropriate topic instead.<br />A page is treated as
dismbiguation if it is linked from $1.<br />Links from other namespaces
are <i>not</i> 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>
--
To view, visit https://gerrit.wikimedia.org/r/74096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4afa30bf2677c6541ef355013f8eaef46abfbe03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits