Page MenuHomePhabricator

Add tag parameter to API action=rollback
Closed, ResolvedPublic

Description

For use by Huggle.

Event Timeline

TTO created this task.Sep 9 2015, 1:20 PM
TTO updated the task description. (Show Details)
TTO raised the priority of this task from to Low.
TTO added a project: MediaWiki-Change-tagging.
TTO moved this task from Backlog to Feature requests on the MediaWiki-Change-tagging board.
TTO added subscribers: Anomie, TTO, Petrb and 4 others.
Anomie set Security to None.
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.

Right now it doesn't seem to be possible even to extensions. AbuseFilter seem to ignore rollbacks as well.

Petrb added a comment.Sep 15 2015, 1:03 PM

What is internal name for "Tags" in mediawiki code. I found parameter $flags in doEdit(), which is missing in doRollback() that might be that. If it's true, this parameter probably needs to be implemented there in first place, otherwise there is likely no way to perform a rollback with "Tags".

Petrb added a comment.Sep 15 2015, 1:04 PM
This comment was removed by Petrb.
Petrb added a comment.EditedSep 15 2015, 1:27 PM

It seems that tags are located in EditPage class, which is however completely bypassed by ApiRollback as it directly calls WikiPage->doRollback which doesn't seem to contain any parameter that could be used to pass the tags. So, the code of doRollback probably would need to modified so that it's possible to pass any tags to it.

Right now it doesn't seem to be possible even to extensions. AbuseFilter seem to ignore rollbacks as well.

It's possible for extensions, but AbuseFilter doesn't match rollbacks, see T24713.

I'll mentor this in #GCI2015. The mission here is basically to replicate what was done at https://gerrit.wikimedia.org/r/#/c/230526/6/includes/api/ApiDelete.php (up to line 105 on the right side of the diff), but for ApiRollback.php instead.

Mhutti1 claimed this task.Dec 15 2015, 11:11 PM

Change 259428 had a related patch set uploaded (by Mhutti1):
Add tag parameter to API action=rollback

https://gerrit.wikimedia.org/r/259428

TTO closed this task as Resolved.Dec 17 2015, 12:30 AM

Change 259428 merged by jenkins-bot:
Add tag parameter to API action=rollback

https://gerrit.wikimedia.org/r/259428

We'll run into the same issues as T100248, since the RC is deferred but not the addition of tags. I'll make a commit that fixes that.