X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FMovePage.php;h=ecd12c6f8e8c75559f2e19fbdab2cecd14ba392b;hb=ec83f37eb865e32931b29b2c133dddfab665cf46;hp=ec44b6eb699c4b2351abc9f32dcb60d6e918cbfb;hpb=8c96aec32cffaab96b2bd9dca206a99a13640545;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/MovePage.php b/includes/MovePage.php index ec44b6eb69..ecd12c6f8e 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -523,15 +523,6 @@ class MovePage { $newpage = WikiPage::factory( $nt ); - # Save a null revision in the page's history notifying of the move - $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true, $user ); - if ( !is_object( $nullRevision ) ) { - throw new MWException( 'No valid null revision produced in ' . __METHOD__ ); - } - - $nullRevId = $nullRevision->insertOn( $dbw ); - $logEntry->setAssociatedRevId( $nullRevId ); - # Change the name of the target page: $dbw->update( 'page', /* SET */ [ @@ -542,6 +533,16 @@ class MovePage { __METHOD__ ); + # Save a null revision in the page's history notifying of the move + $nullRevision = Revision::newNullRevision( $dbw, $oldid, $comment, true, $user ); + if ( !is_object( $nullRevision ) ) { + throw new MWException( 'Failed to create null revision while moving page ID ' + . $oldid . ' to ' . $nt->getPrefixedDBkey() ); + } + + $nullRevId = $nullRevision->insertOn( $dbw ); + $logEntry->setAssociatedRevId( $nullRevId ); + if ( !$redirectContent ) { // Clean up the old title *before* reset article id - T47348 WikiPage::onArticleDelete( $this->oldTitle );