Last modified: 2013-08-01 09:58:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48352, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46352 - Undo operations in the Wikibase API
Undo operations in the Wikibase API
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
: need-volunteer
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-20 11:09 UTC by jeblad
Modified: 2013-08-01 09:58 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description jeblad 2013-03-20 11:09:56 UTC
It should be possible to do undo operations through the API on items and other entities. This is currently blocked because the present diff/patch solution is line based.

If we implement our own wbundo it could be nice to support reset/rollback etc through the same interface.
Comment 1 db [inactive,noenotif] 2013-06-23 18:12:08 UTC
The line based diff is only a problem, when the undo rev needs merge.
But it works for gui, so there should not be a problem to have it in api
Comment 2 denny vrandecic 2013-06-27 11:02:40 UTC
Investigate whether the API action edit works with the undo and undoafter parameters does already work or not. This might already be working.
Comment 3 Daniel Kinzler 2013-06-27 12:46:50 UTC
Specifically, the API should be using the EditEntityAction class to perform these actions on Wikibase entitites.
Comment 4 Daniel Kinzler 2013-07-01 12:06:50 UTC
I poked at this a bit; as it turns out, ApiEditPage has it's own undo logic. So instead of diverting that (as suggested above) into Wikibase\EditEntityAction somehow, we should implement EntityContent::getUndoContent() based on EntityDiffer.

Note that WikibaseHooks::onApiCheckCanExecute currently prevents ApiEditPage from working on wikibase entities. We'll need to make an exception there:

	if ( isset( $params['undo'] ) && $params['undo'] > 0 ) {
		// We don't allow direct editing, but direct undoing is ok!
		return true;
	}
Comment 5 Gerrit Notification Bot 2013-07-16 10:01:49 UTC
Change 73942 had a related patch set uploaded by Daniel Kinzler:
(bug 46352) Implement EntityHandler::getUndoContent

https://gerrit.wikimedia.org/r/73942
Comment 6 Gerrit Notification Bot 2013-07-26 10:49:51 UTC
Change 73942 merged by jenkins-bot:
(bug 46352) Implement EntityHandler::getUndoContent

https://gerrit.wikimedia.org/r/73942
Comment 7 abraham.taherivand 2013-08-01 09:58:05 UTC
Verified in Wikidata demo July 31th.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links