Page MenuHomePhabricator

Add action=patrol
Closed, ResolvedPublic

Description

Author: Bryan.TongMinh

Description:
Add a patrol module, action=patrol to the API.


Version: 1.14.x
Severity: enhancement

Details

Reference
bz15445

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:18 PM
bzimport set Reference to bz15445.
  • Bug 15447 has been marked as a duplicate of this bug. ***

soxred93 wrote:

Proposed patch

Patch implementing new action

Parameters:
title
id
token
gettoken

attachment my.patch ignored as obsolete

soxred93 wrote:

Add RELEASE-NOTES

attachment my.patch ignored as obsolete

soxred93 wrote:

Uncomment the post-only stamement

attachment my.patch ignored as obsolete

(In reply to comment #4)

Created an attachment (id=5269) [details]
Uncomment the post-only stamement

  • You don't need the title parameter, you don't need to create a Title and an Article and you don't need to check for their validity. You're not actually using any of these anywhere. An rcid is enough to patrol a change
  • The gettoken method for getting tokens is deprecated in favor of retrieving tokens through prop=info or prop=revisions. The old gettoken parameters are still there and won't be removed, of course (backwards compatibility), but we shouldn't be adding new ones. Patrol tokens should probably be added to list=recentchanges
  • Please use $wgUseRCPatrol instead of $GLOBALS['wgUseRCPatrol'], particularly because you do use $wgUser earlier on
  • The id parameter should be renamed to rcid and be specified as an integer
  • In the 'patrolnotenabled' message, please use "Patrolling _is_ not enabled on this wiki". That sounds a little anal, and maybe it is, but we're trying to avoid overly concise error messages
  • In the 'cantpatrol' message, "patrolling pages" is used, while we're really patrolling _changes_ (entries in the recentchanges table)

soxred93 wrote:

Improvements

*Title parameter removed
*Gettoken commented out
*$wgUseRCPatrol and $wgUseNPPatrol enabled
*id is now rcid, and an extra check added, checking if rcid is equal to int(rcid).
*Disabled messages fixed.
*s/pages/changes

attachment my.patch ignored as obsolete

soxred93 wrote:

Used the wrong diff

attachment my.patch ignored as obsolete

soxred93 wrote:

Sigh...new patch

attachment my.patch ignored as obsolete

soxred93 wrote:

Add rcid to allowed params

attachment my.patch ignored as obsolete

Quick note -- there's commented-out code in the latest version of the patch. If it's not needed, just take it out! :)

soxred93 wrote:

Remove comments

If you wish, brion...

Attached:

Modified version of patch applied in r40435, along with a split of the patrol code