Revert r37748 "(bug 14020) Added an API interface to Special:Unwatchedpages in the...
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 17 Jul 2008 09:26:01 +0000 (09:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 17 Jul 2008 09:26:01 +0000 (09:26 +0000)
This is broken -- watched page filter results in a huge wash of duplicate rows -- one for each watcher for each page.

RELEASE-NOTES
includes/api/ApiQueryAllpages.php

index 6c18eaa..6db1ed5 100644 (file)
@@ -530,7 +530,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added flag "top" to list=usercontribs if the user is the last contributor to
   the page
 * list=exturlusage in "list all links" mode can now filter by protocol
-* (bug 14020) Added apfilterwatched parameter to list=allpages
 
 === Languages updated in 1.13 ===
 
index 3176a87..c4ac486 100644 (file)
@@ -51,6 +51,7 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
        }
 
        private function run($resultPageSet = null) {
+
                $db = $this->getDB();
 
                $params = $this->extractRequestParams();
@@ -96,29 +97,6 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        $this->dieUsage('prlevel may not be used without prtype', 'params');
                }
 
-               // Only allow watched page filtering if the user has the 'unwatchedpages' permission
-               // $wgMiserMode disables this
-               global $wgUser, $wgMiserMode;
-               if ($wgUser->isAllowed('unwatchedpages') && !$wgMiserMode) {
-                       if($params['filterwatched'] != 'all') {
-                               $this->addTables('watchlist');
-                               $this->addJoinConds(array('watchlist' => array('LEFT JOIN', array(
-                                               'wl_namespace = page_namespace',
-                                               'wl_title = page_title'))));
-                       }
-                       if($params['filterwatched'] == 'unwatched') {
-                               $this->addWhere('wl_title IS NULL');
-                       }
-                       else if ($params['filterwatched'] == 'watched') {
-                               $this->addWhere('wl_title IS NOT NULL');
-                       }
-               }
-               else if($params['filterwatched'] != 'all') {
-                       if($wgMiserMode)
-                               $this->setWarning('apfilterwatched is disabled on this wiki for performance reasons');
-                       else
-                               $this->setWarning('You don\'t have permission to filter by watched status');
-               }
                if($params['filterlanglinks'] == 'withoutlanglinks') {
                        $this->addTables('langlinks');
                        $this->addJoinConds(array('langlinks' => array('LEFT JOIN', 'page_id=ll_from')));
@@ -130,7 +108,7 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        $forceNameTitleIndex = false;
                }
                if ($forceNameTitleIndex)
-                       $this->addOption('USE INDEX', array('page' => 'name_title'));
+                       $this->addOption('USE INDEX', 'name_title');
 
                if (is_null($resultPageSet)) {
                        $this->addFields(array (
@@ -228,14 +206,6 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                                        'all'
                                ),
                                ApiBase :: PARAM_DFLT => 'all'
-                       ),
-                       'filterwatched' => array(
-                               ApiBase :: PARAM_TYPE => array(
-                                       'watched',
-                                       'unwatched',
-                                       'all'
-                               ),
-                               ApiBase :: PARAM_DFLT => 'all'
                        )
                );
        }
@@ -252,7 +222,6 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        'prtype' => 'Limit to protected pages only',
                        'prlevel' => 'The protection level (must be used with apprtype= parameter)',
                        'filterlanglinks' => 'Filter based on whether a page has langlinks',
-                       'filterwatched' => 'Filter based on whther a page is watched (requires \'unwatchedpages\' right)',
                        'limit' => 'How many total pages to return.'
                );
        }