Page MenuHomePhabricator

Fix undeletion of items
Closed, ResolvedPublic

Description

It should just work, but we have no tests for deleting and undeleting items.


Version: unspecified
Severity: major

Details

Reference
bz38958

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:51 AM
bzimport set Reference to bz38958.
bzimport added a subscriber: Unknown Object (MLST).

Setting to "major", because it's quite important that undeletion works properly.

It's likely that undeletion does NOT work properly at the moment, since it will, as far as I can see, bypass EntityObject::structuredSave() and also any checks for global consistency e.g. unique sitelinks.

Implementation note: Practically, we must make sure that undeleting a Wikidata Entity uses the Entity::save() method instead of WikiPage::doEditContent().

In case undeletion is not possibly because of global consistency constraints (like unique sitelinks), we should filter out the conflicting sitelinks, show a diff and let the user confirm saving the modified version. This is related to filtering undo/restore operations based on global constraints, as described in bug 39428.

Confirmed that undeletion caused database corruption when conflicts arise from sitelinks. Fixed in I41bab989.

Demoed and accepted. Needs selenium tests.

Oh: automatically removing the conflict and then prompt the user to save the resulting new revision would be nice, but should be filed as a separate feature request.