* (bug 2483) Run link updates on change via XML import
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Jun 2006 19:07:24 +0000 (19:07 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 27 Jun 2006 19:07:24 +0000 (19:07 +0000)
RELEASE-NOTES
includes/SpecialImport.php

index 440687e..21053b6 100644 (file)
@@ -573,6 +573,7 @@ Some default configuration options have changed:
 * (bug 672) Add MathAfterTexvc hook
 * Update to Piedmontese localization (pms)
 * dumpBackup can optionally compress via dbzip2
+* (bug 2483) Run link updates on change via XML import
 
 
 == Compatibility ==
index 07ba40a..37d6e5d 100644 (file)
@@ -211,6 +211,9 @@ class WikiRevision {
                if( $pageId == 0 ) {
                        # must create the page...
                        $pageId = $article->insertOn( $dbw );
+                       $created = true;
+               } else {
+                       $created = false;
                }
 
                # FIXME: Check for exact conflicts
@@ -232,8 +235,27 @@ class WikiRevision {
                        'minor_edit' => $this->minor,
                        ) );
                $revId = $revision->insertOn( $dbw );
-               $article->updateIfNewerOn( $dbw, $revision );
+               $changed = $article->updateIfNewerOn( $dbw, $revision );
 
+               if( $created ) {
+                       wfDebug( __METHOD__ . ": running onArticleCreate\n" );
+                       Article::onArticleCreate( $this->title );
+               } else {
+                       if( $changed ) {
+                               wfDebug( __METHOD__ . ": running onArticleEdit\n" );
+                               Article::onArticleEdit( $this->title );
+                       }
+               }
+               if( $created || $changed ) {
+                       wfDebug( __METHOD__ . ": running edit updates\n" );
+                       $article->editUpdates(
+                               $this->getText(),
+                               $this->getComment(),
+                               $this->minor,
+                               $this->timestamp,
+                               $revId );
+               }
+               
                return true;
        }