From 99141d2a5d8f32512a977f049d7d8293e132d133 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Tue, 8 May 2007 09:26:58 +0000 Subject: [PATCH] Special:Undelete doesn't update page_latest when undeleted revision was newer than existing revisions, causes wrong display and corrupt link tables --- includes/SpecialUndelete.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 ); } -- 2.20.1