From 299b3fbddf96d47e1434f4499a65bb98f9d2eccd Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 9 Jul 2011 18:57:33 +0000 Subject: [PATCH] Call doMarkPatrolled() on the RecentChange object instead of calling RecentChange::markPatrolled() that will create a second instance --- includes/api/ApiPatrol.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ) ); -- 2.20.1