From: Gergő Tisza Date: Tue, 12 Jan 2016 03:09:24 +0000 (-0800) Subject: Fall back to autoincrement when page cannot be recreated with old ID X-Git-Tag: 1.31.0-rc.0~8371^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=a7230503c274d436db795aa41961e610f997325d;p=lhc%2Fweb%2Fwiklou.git Fall back to autoincrement when page cannot be recreated with old ID Fixes I882b8ba09d68e7475e1d0934328730059574e292. Bug: T28123 Change-Id: Ib029407d8e21f041803131143ff4dc0856803c60 --- 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...