* (bug 7510) Update article counts etc on undelete
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 02:15:12 +0000 (02:15 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 02:15:12 +0000 (02:15 +0000)
RELEASE-NOTES
includes/Article.php
includes/SpecialUndelete.php

index c228869..9984a2f 100644 (file)
@@ -275,6 +275,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Made messages used in Special:Preferences either plain text or wikitext (toggles)
 * Replaced {{SERVER}}{{localurl:xxx}} with {{fullurl:xxx}} in localisation files
 * Fix regression in Special:Watchlist text header
+* (bug 7510) Update article counts etc on undelete
 
 
 == Languages updated ==
index 5f81730..8c07b06 100644 (file)
@@ -2161,6 +2161,22 @@ class Article {
 
                wfProfileOut( __METHOD__ );
        }
+       
+       /**
+        * Perform article updates on a special page creation.
+        *
+        * @param Revision $rev
+        *
+        * @fixme This is a shitty interface function. Kill it and replace the
+        * other shitty functions like editUpdates and such so it's not needed
+        * anymore.
+        */
+       function createUpdates( $rev ) {
+               $this->mGoodAdjustment = $this->isCountable( $rev->getText() );
+               $this->mTotalAdjustment = 1;
+               $this->editUpdates( $rev->getText(), $rev->getComment(),
+                       $rev->isMinor(), wfTimestamp(), $rev->getId(), true );
+       }
 
        /**
         * Generate the navigation links when browsing through an article revisions
index 1db80e5..8e0291e 100644 (file)
@@ -350,17 +350,11 @@ class PageArchive {
                if( $revision ) {
                        # FIXME: Update latest if newer as well...
                        if( $newid ) {
-                               # FIXME: update article count if changed...
+                               // Attach the latest revision to the page...
                                $article->updateRevisionOn( $dbw, $revision, $previousRevId );
-
-                               # Finally, clean up the link tables
-                               $options = new ParserOptions;
-                               $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options,
-                                       true, true, $newRevId );
-                               $u = new LinksUpdate( $this->title, $parserOutput );
-                               $u->doUpdate();
-
-                               #TODO: SearchUpdate, etc.
+                               
+                               // Update site stats, link tables, etc
+                               $article->createUpdates( $revision );
                        }
 
                        if( $newid ) {