From: Jack Phoenix Date: Mon, 19 Jan 2009 15:35:15 +0000 (+0000) Subject: adding a new hook from wikia codebase into SpecialWantedpages.php to allow extensions... X-Git-Tag: 1.31.0-rc.0~43353 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=680b3a56bb3b1ee91ed6740de4081aefcae5d9e5;p=lhc%2Fweb%2Fwiklou.git adding a new hook from wikia codebase into SpecialWantedpages.php to allow extensions to alter the SQL query --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6b1957bd64..38d2c3a6a9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/docs/hooks.txt b/docs/hooks.txt index 22db827691..3fd131d9a5 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialWantedpages.php b/includes/specials/SpecialWantedpages.php index 1013340995..6f7e727c8c 100644 --- a/includes/specials/SpecialWantedpages.php +++ b/includes/specials/SpecialWantedpages.php @@ -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; } /**