* (bug 23017) Special:Disambiguations now list pages in content namespaces rather...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 6 Apr 2010 20:00:26 +0000 (20:00 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 6 Apr 2010 20:00:26 +0000 (20:00 +0000)
RELEASE-NOTES
includes/specials/SpecialDisambiguations.php

index bda8f36..21e0b22 100644 (file)
@@ -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
index 1941112..a810391 100644 (file)
@@ -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'