r53052 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r53051 | r53052 (on ViewVC) | r53053 >
Date:13:55, 10 July 2009
Author:midom
Status:resolved (Comments)
Tags:live 
Comment:don't allow querying specific namespace if misermode is enabled
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryCategoryMembers.php	(revision 53051)
+++ trunk/phase3/includes/api/ApiQueryCategoryMembers.php	(revision 53052)
@@ -83,7 +83,12 @@
 		$this->addWhere('cl_from=page_id');
 		$this->setContinuation($params['continue'], $params['dir']);
 		$this->addWhereFld('cl_to', $categoryTitle->getDBkey());
-		$this->addWhereFld('page_namespace', $params['namespace']);
+		# Scanning large datasets for rare categories sucks, and I already told 
+		# how to have efficient subcategory access :-) ~~~~ (oh well, domas)
+		global $wgMiserMode;
+		if (!$wgMiserMode) { 
+			$this->addWhereFld('page_namespace', $params['namespace']);
+		}
 		if($params['sort'] == 'timestamp')
 			$this->addWhereRange('cl_timestamp', ($params['dir'] == 'asc' ? 'newer' : 'older'), $params['start'], $params['end']);
 		else

Follow-up revisions

RevisionCommit summaryAuthorDate
r53087Followup to r53052 - Die if someone tries to use the namespace filter, rather th...mrzman23:46, 10 July 2009
r53168Followup to r53087 / r53052 - Change dieUsage to setWarning per CodeReviewmrzman14:54, 13 July 2009

Comments

#Comment by Anomie (Talk | contribs)   22:01, 10 July 2009

Good that you "already told". Bad that you didn't bother to tell any of us who aren't whoever you already told; especially since this breaks many bots, we could better clamor for the fix if we knew what it was.

#Comment by Umherirrender (Talk | contribs)   11:52, 11 July 2009

Please tag version with "live", when [http://wikitech.wikimedia.org/index.php?title=Server_admin_log&diff=20849&oldid=20848 synchronized] them. Thanks.

Please also synchronized r53087, so bots/user get a message. That makes it easy to find, why bots are not working. Thanks.

Status & tagging log

Views
Toolbox