Page MenuHomePhabricator

Undeletion fails
Closed, ResolvedPublic

Description breaks undeletion of items

Page ID 196 mismatches the ID 197 provided by the Title object.


#0 /var/www/common/php-master/includes/Revision.php(188): Revision->__construct(Array)
#1 /var/www/common/php-master/includes/specials/SpecialUndelete.php(598): Revision::newFromArchiveRow(Object(stdClass), Array)
#2 /var/www/common/php-master/includes/specials/SpecialUndelete.php(381): PageArchive->undeleteRevisions(Array, false, '')
#3 /var/www/common/php-master/includes/specials/SpecialUndelete.php(1510): PageArchive->undelete(Array, '', Array, false, Object(User))
#4 /var/www/common/php-master/includes/specials/SpecialUndelete.php(778): SpecialUndelete->undelete()
#5 /var/www/common/php-master/includes/SpecialPage.php(599): SpecialUndelete->execute(NULL)
#6 /var/www/common/php-master/includes/SpecialPageFactory.php(497): SpecialPage->run(NULL)
#7 /var/www/common/php-master/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#8 /var/www/common/php-master/includes/Wiki.php(555): MediaWiki->performRequest()
#9 /var/www/common/php-master/includes/Wiki.php(448): MediaWiki->main()
#10 /var/www/common/php-master/index.php(59): MediaWiki->run()
#11 /var/www/common/live-1.5/index.php(3): require('/var/www/common...')
#12 {main}

with this followup, it now just fails silently, including on :( (check the deletion log, I created this for test purpose, deleted it and undeleted and it

It shows "03:57, 1 November 2012 Katie Filbert (WMDE) (Talk | contribs) restored page Q5084 (1 revision restored: test)"

but the page says "This item does not exist. You can search the related logs to find out where it went, or create a new item."

The failure happens on my test instance too, and believe it occurs only with $wgContentHandlerUseDB = true and only with items.

I am trying this with different versions of the repo and with the Deletion and Undeletion hooks commented out. With the undeletion hook, it's having trouble with $rev->getContent() and sure it worked before.

Version: 1.21.x
Severity: critical



Event Timeline

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

This fixes the issue

The current use case of Wikidata does not mix non-default content in a namespace (e.g. wikitext in the item namespace), so this will work for now.

To have non-default content models and formats for a new revision or page, we will have to come up with a better solution.

The code for handling archived revisions and undeletions in core is a bit ugly and we'll have to work around it in some other way.

Same fix as for bug 41615 which is also marked as blocking.

[Aude: Any chance to mention bug IDs in Gerrit commit messages, if possible?
Makes searching the other way round easier. Thanks for considering.]

The above fatal error is caused by this revert: I789e45bd. However, undeletion did fail silently before: it would claim to undelete the page, but the page would have no content and no revisions.

On the database level, this was caused by the revisions being restored with rev_page containing the original page ID instead of the ID of the newly created page.

A fix for both issues is here: I796fe54e

Closed older resolved bugs as verified.