r91800 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91799‎ | r91800 | r91801 >
Date:18:57, 9 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Call doMarkPatrolled() on the RecentChange object instead of calling RecentChange::markPatrolled() that will create a second instance
Modified paths:
  • /trunk/phase3/includes/api/ApiPatrol.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiPatrol.php
@@ -42,13 +42,15 @@
4343 * Patrols the article or provides the reason the patrol failed.
4444 */
4545 public function execute() {
 46+ global $wgUser;
 47+
4648 $params = $this->extractRequestParams();
4749
4850 $rc = RecentChange::newFromID( $params['rcid'] );
4951 if ( !$rc instanceof RecentChange ) {
5052 $this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) );
5153 }
52 - $retval = RecentChange::markPatrolled( $params['rcid'] );
 54+ $retval = $rc->doMarkPatrolled( $wgUser );
5355
5456 if ( $retval ) {
5557 $this->dieUsageMsg( reset( $retval ) );

Status & tagging log