/w/index.php?title=Q4060911&action=edit&undoafter=211322910&undo=212116913 Diff\Patcher\PatcherException from line 586 of /srv/mediawiki/php-1.26wmf2/extensions/Wikidata/extensions/Wikibase/repo/includes/content/EntityContent.php: EntityContent must not contain Entity data as well as a redirect after applying the patch! #0 /srv/mediawiki/php-1.26wmf2/extensions/Wikidata/extensions/Wikibase/repo/includes/actions/EditEntityAction.php(314): Wikibase\EntityContent->getPatchedCopy() #1 /srv/mediawiki/php-1.26wmf2/extensions/Wikidata/extensions/Wikibase/repo/includes/actions/EditEntityAction.php(262): Wikibase\EditEntityAction->showUndoForm() #2 /srv/mediawiki/php-1.26wmf2/includes/MediaWiki.php(395): Wikibase\EditEntityAction->show() #3 /srv/mediawiki/php-1.26wmf2/includes/MediaWiki.php(273): MediaWiki->performAction() #4 /srv/mediawiki/php-1.26wmf2/includes/MediaWiki.php(566): MediaWiki->performRequest() #5 /srv/mediawiki/php-1.26wmf2/includes/MediaWiki.php(414): MediaWiki->main() #6 /srv/mediawiki/php-1.26wmf2/index.php(46): MediaWiki->run() #7 /srv/mediawiki/w/index.php(3): include()
Possible cause: trying to undo an edit that turned an entity into a redirect (or vice versa), when that edit is not the latest edit (that is, when the undo involved diff-based patching).
Reproduction path:
- Create a new Item with a single label
- Remove the label
- Redirect the now empty Item to another Item
- Go to the history page and attempt to undo the edit that removed the label
Possible fix: when an undo is requested, first check whether the current revision has the same redirect status as the revision to be undone. If not, undo should fail gracefully.
Acceptance Criteria
- reproducing the issue results in an error displayed neatly to the user, something along the lines of "undo not possible"
- Error does not appear in production logs