From a7230503c274d436db795aa41961e610f997325d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerg=C5=91=20Tisza?= Date: Mon, 11 Jan 2016 19:09:24 -0800 Subject: [PATCH] Fall back to autoincrement when page cannot be recreated with old ID Fixes I882b8ba09d68e7475e1d0934328730059574e292. Bug: T28123 Change-Id: Ib029407d8e21f041803131143ff4dc0856803c60 --- includes/specials/SpecialUndelete.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index b36860ff1d..744a0909cf 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -569,6 +569,10 @@ class PageArchive { } // Safe to insert now... $newid = $article->insertOn( $dbw, $row->ar_page_id ); + if ( $newid === false ) { + // The old ID is reserved; let's pick another + $newid = $article->insertOn( $dbw ); + } $pageId = $newid; } else { // Check if a deleted revision will become the current revision... -- 2.20.1