r16880 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16879‎ | r16880 | r16881 >
Date:02:15, 9 October 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 7510) Update article counts etc on undelete
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2161,6 +2161,22 @@
21622162
21632163 wfProfileOut( __METHOD__ );
21642164 }
 2165+
 2166+ /**
 2167+ * Perform article updates on a special page creation.
 2168+ *
 2169+ * @param Revision $rev
 2170+ *
 2171+ * @fixme This is a shitty interface function. Kill it and replace the
 2172+ * other shitty functions like editUpdates and such so it's not needed
 2173+ * anymore.
 2174+ */
 2175+ function createUpdates( $rev ) {
 2176+ $this->mGoodAdjustment = $this->isCountable( $rev->getText() );
 2177+ $this->mTotalAdjustment = 1;
 2178+ $this->editUpdates( $rev->getText(), $rev->getComment(),
 2179+ $rev->isMinor(), wfTimestamp(), $rev->getId(), true );
 2180+ }
21652181
21662182 /**
21672183 * Generate the navigation links when browsing through an article revisions
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -350,17 +350,11 @@
351351 if( $revision ) {
352352 # FIXME: Update latest if newer as well...
353353 if( $newid ) {
354 - # FIXME: update article count if changed...
 354+ // Attach the latest revision to the page...
355355 $article->updateRevisionOn( $dbw, $revision, $previousRevId );
356 -
357 - # Finally, clean up the link tables
358 - $options = new ParserOptions;
359 - $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options,
360 - true, true, $newRevId );
361 - $u = new LinksUpdate( $this->title, $parserOutput );
362 - $u->doUpdate();
363 -
364 - #TODO: SearchUpdate, etc.
 356+
 357+ // Update site stats, link tables, etc
 358+ $article->createUpdates( $revision );
365359 }
366360
367361 if( $newid ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -275,6 +275,7 @@
276276 * Made messages used in Special:Preferences either plain text or wikitext (toggles)
277277 * Replaced {{SERVER}}{{localurl:xxx}} with {{fullurl:xxx}} in localisation files
278278 * Fix regression in Special:Watchlist text header
 279+* (bug 7510) Update article counts etc on undelete
279280
280281
281282 == Languages updated ==