X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPatrol.php;h=06e8ae28c2261f98b9bcee48c274e635025e15fa;hb=c16af68fb62948dd8079a7fa49b7c12b9a748121;hp=62528825ded0e9e8911d8128807194cacf52a094;hpb=42324aff4e173b70aeed4f520ff0f5b96557d24e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 62528825de..06e8ae28c2 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -40,19 +40,16 @@ class ApiPatrol extends ApiBase { if ( isset( $params['rcid'] ) ) { $rc = RecentChange::newFromId( $params['rcid'] ); if ( !$rc ) { - $this->dieUsageMsg( [ 'nosuchrcid', $params['rcid'] ] ); + $this->dieWithError( [ 'apierror-nosuchrcid', $params['rcid'] ] ); } } else { $rev = Revision::newFromId( $params['revid'] ); if ( !$rev ) { - $this->dieUsageMsg( [ 'nosuchrevid', $params['revid'] ] ); + $this->dieWithError( [ 'apierror-nosuchrevid', $params['revid'] ] ); } $rc = $rev->getRecentChange(); if ( !$rc ) { - $this->dieUsage( - 'The revision ' . $params['revid'] . " can't be patrolled as it's too old", - 'notpatrollable' - ); + $this->dieWithError( [ 'apierror-notpatrollable', $params['revid'] ] ); } } @@ -70,7 +67,7 @@ class ApiPatrol extends ApiBase { $retval = $rc->doMarkPatrolled( $user, false, $tags ); if ( $retval ) { - $this->dieUsageMsg( reset( $retval ) ); + $this->dieStatus( $this->errorArrayToStatus( $retval, $user ) ); } $result = [ 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) ]; @@ -115,6 +112,6 @@ class ApiPatrol extends ApiBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Patrol'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Patrol'; } }