r85772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85771‎ | r85772 | r85773 >
Date:21:52, 10 April 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 26873) API: Add 'toponly' filter in usercontribs module
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -620,7 +620,7 @@
621621 'type' => 'Which types of changes to show',
622622 'limit' => 'How many total changes to return',
623623 'tag' => 'Only list changes tagged with this tag',
624 - 'toponly' => 'Only list changes which are the latest revision'
 624+ 'toponly' => 'Only list changes which are the latest revision',
625625 );
626626 }
627627
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -81,6 +81,7 @@
8282 $this->prefixMode = false;
8383 $this->multiUserMode = ( count( $this->params['user'] ) > 1 );
8484 }
 85+
8586 $this->prepareQuery();
8687
8788 // Do the actual query.
@@ -264,6 +265,10 @@
265266 $index['change_tag'] = $wgOldChangeTagsIndex ? 'ct_tag' : 'change_tag_tag_id';
266267 }
267268
 269+ if ( $this->params['toponly'] ) {
 270+ $this->addWhere( 'rev_id = page_latest' );
 271+ }
 272+
268273 $this->addOption( 'USE INDEX', $index );
269274 }
270275
@@ -409,6 +414,7 @@
410415 )
411416 ),
412417 'tag' => null,
 418+ 'toponly' => false,
413419 );
414420 }
415421
@@ -439,6 +445,7 @@
440446 'show' => array( "Show only items that meet this criteria, e.g. non minor edits only: {$p}show=!minor",
441447 "NOTE: if {$p}show=patrolled or {$p}show=!patrolled is set, revisions older than $wgRCMaxAge won\'t be shown", ),
442448 'tag' => 'Only list revisions tagged with this tag',
 449+ 'toponly' => 'Only list changes which are the latest revision',
443450 );
444451 }
445452
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -758,7 +758,7 @@
759759 /**
760760 * Get the Database object in use
761761 *
762 - * @return Database
 762+ * @return DatabaseBase
763763 */
764764 public function getDatabase() {
765765 return $this->mDb;
Index: trunk/phase3/RELEASE-NOTES
@@ -333,6 +333,7 @@
334334 PARAM_TYPE is not set
335335 * (bug 27712) add parent_id to list=deletedrevs
336336 * (bug 28455) Add 'toponly' to recentchanges API module
 337+* (bug 26873) API: Add 'toponly' filter in usercontribs module
337338
338339 === Languages updated in 1.18 ===
339340

Status & tagging log