From b978932112e91ba1234a28fc0d968bd35ed8761d Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 6 Apr 2010 20:00:26 +0000 Subject: [PATCH] * (bug 23017) Special:Disambiguations now list pages in content namespaces rather than only main namespace --- RELEASE-NOTES | 2 ++ includes/specials/SpecialDisambiguations.php | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bda8f36f6e..21e0b229e5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -86,6 +86,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 22918) Feed cache keys now use $wgRenderHashAppend * (bug 21916) Last-Modified header is now correct when outputting cached feed * (bug 20049) Fixed PHP notice in search highlighter that occurs in some cases +* (bug 23017) Special:Disambiguations now list pages in content namespaces + rather than only main namespace === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index 1941112a46..a81039132a 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -22,6 +22,8 @@ class DisambiguationsPage extends PageQueryPage { } function getSQL() { + global $wgContentNamespaces; + $dbr = wfGetDB( DB_SLAVE ); $dMsgText = wfMsgForContent('disambiguationspage'); @@ -64,12 +66,18 @@ class DisambiguationsPage extends PageQueryPage { list( $page, $pagelinks, $templatelinks) = $dbr->tableNamesN( 'page', 'pagelinks', 'templatelinks' ); + if ( $wgContentNamespaces ) { + $nsclause = 'IN (' . $dbr->makeList( $wgContentNamespaces ) . ')'; + } else { + $nsclause = '= ' . NS_MAIN; + } + $sql = "SELECT 'Disambiguations' AS \"type\", pb.page_namespace AS namespace," ." pb.page_title AS title, la.pl_from AS value" ." FROM {$templatelinks} AS lb, {$page} AS pb, {$pagelinks} AS la, {$page} AS pa" ." WHERE $set" # disambiguation template(s) .' AND pa.page_id = la.pl_from' - .' AND pa.page_namespace = ' . NS_MAIN # Limit to just articles in the main namespace + .' AND pa.page_namespace ' . $nsclause .' AND pb.page_id = lb.tl_from' .' AND pb.page_namespace = la.pl_namespace' .' AND pb.page_title = la.pl_title' -- 2.20.1