Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -515,35 +515,30 @@ |
516 | 516 | __METHOD__ ); |
517 | 517 | |
518 | 518 | // Was anything restored at all? |
519 | | - if( $restored == 0 ) |
| 519 | + if ( $restored == 0 ) { |
520 | 520 | return 0; |
| 521 | + } |
521 | 522 | |
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 | + } |
529 | 529 | |
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 ); |
542 | 533 | } 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 ); |
546 | 536 | } |
547 | 537 | |
| 538 | + if( $this->title->getNamespace() == NS_FILE ) { |
| 539 | + $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); |
| 540 | + $update->doUpdate(); |
| 541 | + } |
| 542 | + |
548 | 543 | return $restored; |
549 | 544 | } |
550 | 545 | |