r25726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25725‎ | r25726 | r25727 >
Date:14:17, 10 September 2007
Author:catrope
Status:old
Tags:
Comment:
*(bug 11275) Enable descending sort in API categorymembers
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -78,12 +78,12 @@
7979 if($params['sort'] == 'timestamp')
8080 {
8181 $this->addOption('USE INDEX', 'cl_timestamp');
82 - $this->addOption('ORDER BY', 'cl_to, cl_timestamp');
 82+ $this->addOption('ORDER BY', 'cl_to, cl_timestamp' . ($params['dir'] == 'desc' ? ' DESC' : ''));
8383 }
8484 else
8585 {
8686 $this->addOption('USE INDEX', 'cl_sortkey');
87 - $this->addOption('ORDER BY', 'cl_to, cl_sortkey, cl_from');
 87+ $this->addOption('ORDER BY', 'cl_to, cl_sortkey' . ($params['dir'] == 'desc' ? ' DESC' : '') . ', cl_from');
8888 }
8989
9090 $this->addWhere('cl_from=page_id');
@@ -203,6 +203,13 @@
204204 'sortkey',
205205 'timestamp'
206206 )
 207+ ),
 208+ 'dir' => array(
 209+ ApiBase :: PARAM_DFLT => 'asc',
 210+ ApiBase :: PARAM_TYPE => array(
 211+ 'asc',
 212+ 'desc'
 213+ )
207214 )
208215 );
209216 }
@@ -213,6 +220,7 @@
214221 'prop' => 'What pieces of information to include',
215222 'namespace' => 'Only include pages in these namespaces',
216223 'sort' => 'Property to sort by',
 224+ 'dir' => 'In which direction to sort',
217225 'continue' => 'For large categories, give the value retured from previous query',
218226 'limit' => 'The maximum number of pages to return.',
219227 );
Index: trunk/phase3/RELEASE-NOTES
@@ -48,6 +48,8 @@
4949
5050 Full API documentation is available at http://www.mediawiki.org/wiki/API
5151
 52+* (bug 11275) Enable descending sort in categorymembers
 53+
5254 === Languages updated in 1.12 ===
5355
5456 * Arabic (ar)

Follow-up revisions

RevisionCommit summaryAuthorDate
r25754Merged revisions 25607-25751 via svnmerge from...david23:02, 10 September 2007

Status & tagging log