Call doMarkPatrolled() on the RecentChange object instead of calling RecentChange...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 9 Jul 2011 18:57:33 +0000 (18:57 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 9 Jul 2011 18:57:33 +0000 (18:57 +0000)
includes/api/ApiPatrol.php

index 04afd1d..58e0499 100644 (file)
@@ -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 ) );