r87920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87919‎ | r87920 | r87921 >
Date:18:06, 12 May 2011
Author:ialex
Status:ok
Tags:
Comment:
Removed dead code path since r27312: $revision cannot be null if $restored is non-zero
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -515,35 +515,30 @@
516516 __METHOD__ );
517517
518518 // Was anything restored at all?
519 - if( $restored == 0 )
 519+ if ( $restored == 0 ) {
520520 return 0;
 521+ }
521522
522 - if( $revision ) {
523 - // Attach the latest revision to the page...
524 - $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId );
525 - if( $newid || $wasnew ) {
526 - // Update site stats, link tables, etc
527 - $article->createUpdates( $revision );
528 - }
 523+ // Attach the latest revision to the page...
 524+ $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId );
 525+ if ( $newid || $wasnew ) {
 526+ // Update site stats, link tables, etc
 527+ $article->createUpdates( $revision );
 528+ }
529529
530 - if( $newid ) {
531 - wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) );
532 - Article::onArticleCreate( $this->title );
533 - } else {
534 - wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) );
535 - Article::onArticleEdit( $this->title );
536 - }
537 -
538 - if( $this->title->getNamespace() == NS_FILE ) {
539 - $update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
540 - $update->doUpdate();
541 - }
 530+ if( $newid ) {
 531+ wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) );
 532+ Article::onArticleCreate( $this->title );
542533 } else {
543 - // Revision couldn't be created. This is very weird
544 - wfDebug( "Undelete: unknown error...\n" );
545 - return false;
 534+ wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) );
 535+ Article::onArticleEdit( $this->title );
546536 }
547537
 538+ if( $this->title->getNamespace() == NS_FILE ) {
 539+ $update = new HTMLCacheUpdate( $this->title, 'imagelinks' );
 540+ $update->doUpdate();
 541+ }
 542+
548543 return $restored;
549544 }
550545

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r27312APIEDIT BRANCH MERGE:...catrope13:56, 8 November 2007

Status & tagging log