From: Alexandre Emsenhuber Date: Sat, 9 Jul 2011 18:57:33 +0000 (+0000) Subject: Call doMarkPatrolled() on the RecentChange object instead of calling RecentChange... X-Git-Tag: 1.31.0-rc.0~28961 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=299b3fbddf96d47e1434f4499a65bb98f9d2eccd;p=lhc%2Fweb%2Fwiklou.git Call doMarkPatrolled() on the RecentChange object instead of calling RecentChange::markPatrolled() that will create a second instance --- diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 04afd1dc58..58e0499455 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -42,13 +42,15 @@ class ApiPatrol extends ApiBase { * Patrols the article or provides the reason the patrol failed. */ public function execute() { + global $wgUser; + $params = $this->extractRequestParams(); $rc = RecentChange::newFromID( $params['rcid'] ); if ( !$rc instanceof RecentChange ) { $this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) ); } - $retval = RecentChange::markPatrolled( $params['rcid'] ); + $retval = $rc->doMarkPatrolled( $wgUser ); if ( $retval ) { $this->dieUsageMsg( reset( $retval ) );