r15096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r15095‎ | r15096 | r15097 >
Date:19:07, 27 June 2006
Author:brion
Status:old
Tags:
Comment:
* (bug 2483) Run link updates on change via XML import
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/SpecialImport.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialImport.php
@@ -211,6 +211,9 @@
212212 if( $pageId == 0 ) {
213213 # must create the page...
214214 $pageId = $article->insertOn( $dbw );
 215+ $created = true;
 216+ } else {
 217+ $created = false;
215218 }
216219
217220 # FIXME: Check for exact conflicts
@@ -232,8 +235,27 @@
233236 'minor_edit' => $this->minor,
234237 ) );
235238 $revId = $revision->insertOn( $dbw );
236 - $article->updateIfNewerOn( $dbw, $revision );
 239+ $changed = $article->updateIfNewerOn( $dbw, $revision );
237240
 241+ if( $created ) {
 242+ wfDebug( __METHOD__ . ": running onArticleCreate\n" );
 243+ Article::onArticleCreate( $this->title );
 244+ } else {
 245+ if( $changed ) {
 246+ wfDebug( __METHOD__ . ": running onArticleEdit\n" );
 247+ Article::onArticleEdit( $this->title );
 248+ }
 249+ }
 250+ if( $created || $changed ) {
 251+ wfDebug( __METHOD__ . ": running edit updates\n" );
 252+ $article->editUpdates(
 253+ $this->getText(),
 254+ $this->getComment(),
 255+ $this->minor,
 256+ $this->timestamp,
 257+ $revId );
 258+ }
 259+
238260 return true;
239261 }
240262
Index: trunk/phase3/RELEASE-NOTES
@@ -573,6 +573,7 @@
574574 * (bug 672) Add MathAfterTexvc hook
575575 * Update to Piedmontese localization (pms)
576576 * dumpBackup can optionally compress via dbzip2
 577+* (bug 2483) Run link updates on change via XML import
577578
578579
579580 == Compatibility ==