r80362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80361‎ | r80362 | r80363 >
Date:00:10, 15 January 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Last bits of bug 24650 Fix API to work with categorylinks changes

Allow optional output of cl_sortkey_prefix (will anyone needed it, no idea)
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -77,12 +77,15 @@
7878 $fld_ids = isset( $prop['ids'] );
7979 $fld_title = isset( $prop['title'] );
8080 $fld_sortkey = isset( $prop['sortkey'] );
 81+ $fld_sortkeyprefix = isset( $prop['sortkeyprefix'] );
8182 $fld_timestamp = isset( $prop['timestamp'] );
8283 $fld_type = isset( $prop['type'] );
8384
8485 if ( is_null( $resultPageSet ) ) {
85 - $this->addFields( array( 'cl_from', 'cl_sortkey', 'page_namespace', 'page_title' ) );
 86+ $this->addFields( array( 'cl_from', 'page_namespace', 'page_title' ) );
8687 $this->addFieldsIf( 'page_id', $fld_ids );
 88+ $this->addFieldsIf( 'cl_sortkey_prefix', $fld_sortkeyprefix );
 89+ $this->addFieldsIf( 'cl_sortkey', $fld_sortkey );
8790 } else {
8891 $this->addFields( $resultPageSet->getPageTableFields() ); // will include page_ id, ns, title
8992 $this->addFields( array( 'cl_from', 'cl_sortkey' ) );
@@ -169,6 +172,9 @@
170173 if ( $fld_sortkey ) {
171174 $vals['sortkey'] = $row->cl_sortkey;
172175 }
 176+ if ( $fld_sortkeyprefix ) {
 177+ $vals['sortkeyprefix'] = $row->cl_sortkey_prefix;
 178+ }
173179 if ( $fld_type ) {
174180 $vals['type'] = $row->cl_type;
175181 }
@@ -227,6 +233,7 @@
228234 'ids',
229235 'title',
230236 'sortkey',
 237+ 'sortkeyprefix',
231238 'type',
232239 'timestamp',
233240 )
@@ -285,11 +292,12 @@
286293 'pageid' => 'Page ID of the category to enumerate. Cannot be used together with cmtitle',
287294 'prop' => array(
288295 'What pieces of information to include',
289 - ' ids - Adds the page ID',
290 - ' title - Adds the title and namespace ID of the page',
291 - ' sortkey - Adds the sortkey used for the category',
292 - ' type - Adds the type that the page has been categorised as',
293 - ' timestamp - Adds the timestamp of when the page was included',
 296+ ' ids - Adds the page ID',
 297+ ' title - Adds the title and namespace ID of the page',
 298+ ' sortkey - Adds the sortkey used for the category (note, may be non human readable)',
 299+ ' sortkeyprefix - Adds the sortkey prefix used for the category',
 300+ ' type - Adds the type that the page has been categorised as',
 301+ ' timestamp - Adds the timestamp of when the page was included',
294302 ),
295303 'namespace' => 'Only include pages in these namespaces',
296304 'type' => 'What type of category members to include',

Follow-up revisions

RevisionCommit summaryAuthorDate
r80363* (bug 24650) Fix API to work with categorylinks changes...reedy00:13, 15 January 2011
r80371Fix spaes from r80362reedy00:50, 15 January 2011
r80540Various fixes for API category changes:...catrope00:13, 19 January 2011
r807221.17: MFT r80324, r80326, r80328, r80339, r80350, r80351, r80355, r80358, r80...catrope23:00, 21 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80324Start of bug 24650 Fix API to work with categorylinks changes...reedy21:08, 14 January 2011
r80358More for bug 24650. Update continue to be usable unique thingreedy00:00, 15 January 2011

Comments

#Comment by Bawolff (talk | contribs)   00:16, 15 January 2011

The description in the help for sortkeyprefix should perhaps be something more clear to the average user. Maybe something like "human readable custom sortkey if different from default".

#Comment by Reedy (talk | contribs)   00:41, 15 January 2011

Quite probably. I knew it needed something, and that was the first thing that came to mind...

Status & tagging log