adding a new hook from wikia codebase into SpecialWantedpages.php to allow extensions...
authorJack Phoenix <ashley@users.mediawiki.org>
Mon, 19 Jan 2009 15:35:15 +0000 (15:35 +0000)
committerJack Phoenix <ashley@users.mediawiki.org>
Mon, 19 Jan 2009 15:35:15 +0000 (15:35 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/specials/SpecialWantedpages.php

index 6b1957b..38d2c3a 100644 (file)
@@ -43,6 +43,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   existing block when modifying an existing block.
 * (bug 17055) "(show/hide)" links to Special:RevisionDelete now use a CSS class 
   rather than hardcoded HTML tags
+* Added new hook 'WantedPages::getSQL' into SpecialWantedpages.php to allow extensions
+  to alter the SQL query which is used to get the list of wanted pages
 
 === Bug fixes in 1.15 ===
 * (bug 16968) Special:Upload no longer throws useless warnings.
index 22db827..3fd131d 100644 (file)
@@ -1451,6 +1451,10 @@ $user: User object
 'UserToggles': called when initialising User::$mToggles, use this to add new toggles
 $toggles: array of toggles to add
 
+'WantedPages::getSQL': called in WantedPagesPage::getSQL(), can be used to alter the SQL query which gets the list of wanted pages
+&$wantedPages: WantedPagesPage object
+&$sql: raw SQL query used to get the list of wanted pages
+
 'WatchArticle': before a watch is added to an article
 $user: user that will watch
 $article: article object to be watched
index 1013340..6f7e727 100644 (file)
@@ -31,8 +31,7 @@ class WantedPagesPage extends QueryPage {
                $dbr = wfGetDB( DB_SLAVE );
                $pagelinks = $dbr->tableName( 'pagelinks' );
                $page      = $dbr->tableName( 'page' );
-               return
-                       "SELECT 'Wantedpages' AS type,
+               $sql = "SELECT 'Wantedpages' AS type,
                                pl_namespace AS namespace,
                                pl_title AS title,
                                COUNT(*) AS value
@@ -46,6 +45,9 @@ class WantedPagesPage extends QueryPage {
                         AND pg2.page_namespace != 8
                         GROUP BY pl_namespace, pl_title
                         HAVING COUNT(*) > $count";
+
+               wfRunHooks( 'WantedPages::getSQL', array( &$this, &$sql ) );
+               return $sql;
        }
 
        /**