r83833 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83832‎ | r83833 | r83834 >
Date:17:16, 13 March 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
* (bug 27340) API: Allow listing of "small" categories
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllCategories.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllCategories.php
@@ -69,6 +69,10 @@
7070 $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
7171 $this->addWhereRange( 'cat_title', $dir, $from, $to );
7272
 73+ $min = $params['minpage'];
 74+ $max = $params['maxpage'];
 75+ $this->addWhereRange( 'cat_pages', $dir, $min, $max );
 76+
7377 if ( isset( $params['prefix'] ) ) {
7478 $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
7579 }
@@ -148,6 +152,14 @@
149153 'descending'
150154 ),
151155 ),
 156+ 'minpage' => array(
 157+ ApiBase::PARAM_DFLT => null,
 158+ ApiBase::PARAM_TYPE => 'integer'
 159+ ),
 160+ 'maxpage' => array(
 161+ ApiBase::PARAM_DFLT => null,
 162+ ApiBase::PARAM_TYPE => 'integer'
 163+ ),
152164 'limit' => array(
153165 ApiBase::PARAM_DFLT => 10,
154166 ApiBase::PARAM_TYPE => 'limit',
@@ -169,6 +181,8 @@
170182 'to' => 'The category to stop enumerating at',
171183 'prefix' => 'Search for all category titles that begin with this value',
172184 'dir' => 'Direction to sort in',
 185+ 'minpage' => 'Minimum number of category page members',
 186+ 'maxpage' => 'Maximum number of category page members',
173187 'limit' => 'How many categories to return',
174188 'prop' => array(
175189 'Which properties to get',
Index: trunk/phase3/RELEASE-NOTES
@@ -248,6 +248,7 @@
249249 in auto generated document, as it is on mw.org
250250 * (bug 27182) API: Add filter by prefix for meta=allmessages
251251 * (bug 27183) API: Add filter by customisation state for meta=allmessages
 252+* (bug 27340) API: Allow listing of "small" categories
252253
253254 === Languages updated in 1.18 ===
254255

Follow-up revisions

RevisionCommit summaryAuthorDate
r91154Minor tweaks for r83833 per CRreedy02:14, 30 June 2011

Comments

#Comment by Reedy (talk | contribs)   20:52, 13 March 2011

Suppose I should probably change the text from category page members.. And maybe the parameter names...

#Comment by Krinkle (talk | contribs)   00:47, 15 March 2011

If you plan on renaming it, please do it sooner rather than later to avoid potential breakage.

#Comment by Reedy (talk | contribs)   11:19, 15 March 2011

Indeed, was just waiting on some input on what to call it...

min/max and changing it from category pages to category members is probably enough....?

#Comment by 😂 (talk | contribs)   20:22, 25 May 2011

+1.

Status & tagging log