From: River Tarnell Date: Tue, 8 May 2007 09:26:58 +0000 (+0000) Subject: Special:Undelete doesn't update page_latest when undeleted revision was newer than... X-Git-Tag: 1.31.0-rc.0~53024 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27static%27%2C%20filename=%27css/bootstrap.css%27%29%20%7D%7D?a=commitdiff_plain;h=99141d2a5d8f32512a977f049d7d8293e132d133;p=lhc%2Fweb%2Fwiklou.git Special:Undelete doesn't update page_latest when undeleted revision was newer than existing revisions, causes wrong display and corrupt link tables --- diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index c31709b7c9..7a322dbd40 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -418,11 +418,10 @@ class PageArchive { } if( $revision ) { - # FIXME: Update latest if newer as well... - if( $newid ) { - // Attach the latest revision to the page... - $article->updateRevisionOn( $dbw, $revision, $previousRevId ); - + // Attach the latest revision to the page... + $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId ); + + if( $newid || $wasnew ) { // Update site stats, link tables, etc $article->createUpdates( $revision ); }