Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php |
— | — | @@ -86,9 +86,11 @@ |
87 | 87 | # Scanning large datasets for rare categories sucks, and I already told |
88 | 88 | # how to have efficient subcategory access :-) ~~~~ (oh well, domas) |
89 | 89 | global $wgMiserMode; |
90 | | - if (!$wgMiserMode) { |
91 | | - $this->addWhereFld('page_namespace', $params['namespace']); |
| 90 | + if ( $wgMiserMode && isset($params['namespace']) ) { |
| 91 | + $this->dieUsage("The cmnamespace option is disabled on this site", 'namespacedisabled'); |
92 | 92 | } |
| 93 | + $this->addWhereFld('page_namespace', $params['namespace']); |
| 94 | + |
93 | 95 | if($params['sort'] == 'timestamp') |
94 | 96 | $this->addWhereRange('cl_timestamp', ($params['dir'] == 'asc' ? 'newer' : 'older'), $params['start'], $params['end']); |
95 | 97 | else |
— | — | @@ -238,10 +240,9 @@ |
239 | 241 | } |
240 | 242 | |
241 | 243 | public function getParamDescription() { |
242 | | - return array ( |
| 244 | + $desc = array ( |
243 | 245 | 'title' => 'Which category to enumerate (required). Must include Category: prefix', |
244 | 246 | 'prop' => 'What pieces of information to include', |
245 | | - 'namespace' => 'Only include pages in these namespaces', |
246 | 247 | 'sort' => 'Property to sort by', |
247 | 248 | 'dir' => 'In which direction to sort', |
248 | 249 | 'start' => 'Timestamp to start listing from. Can only be used with cmsort=timestamp', |
— | — | @@ -251,6 +252,15 @@ |
252 | 253 | 'continue' => 'For large categories, give the value retured from previous query', |
253 | 254 | 'limit' => 'The maximum number of pages to return.', |
254 | 255 | ); |
| 256 | + global $wgMiserMode; |
| 257 | + // We can't remove it from the param list entirely without removing it from the |
| 258 | + // allowed params, but then we could only silently ignore it, which could cause |
| 259 | + // problems for people unaware of the change |
| 260 | + if ( $wgMiserMode ) |
| 261 | + $desc['namespace'] = 'Disabled on this site for performance reasons'; |
| 262 | + else |
| 263 | + $desc['namespace'] = 'Only include pages in these namespaces'; |
| 264 | + return $desc; |
255 | 265 | } |
256 | 266 | |
257 | 267 | public function getDescription() { |
— | — | @@ -269,4 +279,4 @@ |
270 | 280 | public function getVersion() { |
271 | 281 | return __CLASS__ . ': $Id$'; |
272 | 282 | } |
273 | | -} |
\ No newline at end of file |
| 283 | +} |