r88250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88249‎ | r88250 | r88251 >
Date:17:41, 16 May 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Only increment the page count if the page has been created; also simplified a bit the code
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -526,18 +526,21 @@
527527 return 0;
528528 }
529529
 530+ $created = (bool)$newid;
 531+
530532 // Attach the latest revision to the page...
531533 $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId );
532 - if ( $newid || $wasnew ) {
 534+ if ( $created || $wasnew ) {
533535 // Update site stats, link tables, etc
534 - $article->createUpdates( $revision );
 536+ $article->editUpdates( $revision->getText(), $revision->getComment(),
 537+ $revision->isMinor(), wfTimestamp(), $revision->getId(), true, null, $created );
535538 }
536539
537 - if( $newid ) {
538 - wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) );
 540+ wfRunHooks( 'ArticleUndelete', array( &$this->title, $created, $comment ) );
 541+
 542+ if( $created ) {
539543 Article::onArticleCreate( $this->title );
540544 } else {
541 - wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) );
542545 Article::onArticleEdit( $this->title );
543546 }
544547

Sign-offs

UserFlagDate
Hasharinspected13:43, 3 June 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r92328REL1_18 MFT r79056, r80612, r81499, r87627, r87628, r87630, r87998, r88134, r...reedy22:46, 15 July 2011

Comments

#Comment by Hashar (talk | contribs)   13:43, 3 June 2011

Sounds like a step toward fixing bug 19919 "Article count in Special:Statistics incorrect"

#Comment by Hashar (talk | contribs)   20:19, 22 June 2011

+1.18

Status & tagging log